mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
Blackfin SPI Driver: fix NULL pointer crash
Fix NULL pointer crash when cleaning up from invalid platform resources Signed-off-by: Mike Frysinger <[email protected]> Signed-off-by: Bryan Wu <[email protected]> Cc: David Brownell <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
138f97cd06
commit
e7d02e3c95
1 changed files with 3 additions and 0 deletions
|
|
@ -1178,6 +1178,9 @@ static void bfin_spi_cleanup(struct spi_device *spi)
|
|||
{
|
||||
struct chip_data *chip = spi_get_ctldata(spi);
|
||||
|
||||
if (!chip)
|
||||
return;
|
||||
|
||||
if ((chip->chip_select_num > 0)
|
||||
&& (chip->chip_select_num <= spi->master->num_chipselect))
|
||||
peripheral_free(ssel[spi->master->bus_num]
|
||||
|
|
|
|||
Loading…
Reference in a new issue