summaryrefslogtreecommitdiffstats
path: root/drivers/spi/spi_bfin5xx.c
diff options
context:
space:
mode:
authorMike Frysinger <vapier.adi@gmail.com>2009-04-07 04:00:51 +0200
committerLinus Torvalds <torvalds@linux-foundation.org>2009-04-07 17:31:06 +0200
commite7d02e3c9577f070bc77354763bed7f24713dc53 (patch)
tree7c6d62e9e9725c9147825ce131f831d82cff053f /drivers/spi/spi_bfin5xx.c
parentBlackfin SPI Driver: use bfin_spi_ prefix on all functions (diff)
downloadlinux-e7d02e3c9577f070bc77354763bed7f24713dc53.tar.xz
linux-e7d02e3c9577f070bc77354763bed7f24713dc53.zip
Blackfin SPI Driver: fix NULL pointer crash
Fix NULL pointer crash when cleaning up from invalid platform resources Signed-off-by: Mike Frysinger <vapier.adi@gmail.com> Signed-off-by: Bryan Wu <cooloney@kernel.org> Cc: David Brownell <david-b@pacbell.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/spi/spi_bfin5xx.c')
-rw-r--r--drivers/spi/spi_bfin5xx.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/spi/spi_bfin5xx.c b/drivers/spi/spi_bfin5xx.c
index d1ff34f3f6bd..53819c961a31 100644
--- a/drivers/spi/spi_bfin5xx.c
+++ b/drivers/spi/spi_bfin5xx.c
@@ -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]