Commit e7d02e3c authored by Mike Frysinger's avatar Mike Frysinger Committed by Linus Torvalds
Browse files

Blackfin SPI Driver: fix NULL pointer crash

Fix NULL pointer crash when cleaning up from invalid platform resources
Signed-off-by: default avatarMike Frysinger <>
Signed-off-by: default avatarBryan Wu <>
Cc: David Brownell <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent 138f97cd
......@@ -1178,6 +1178,9 @@ static void bfin_spi_cleanup(struct spi_device *spi)
struct chip_data *chip = spi_get_ctldata(spi);
if (!chip)
if ((chip->chip_select_num > 0)
&& (chip->chip_select_num <= spi->master->num_chipselect))
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment