[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1233904388-5765-19-git-send-email-cooloney@kernel.org>
Date: Fri, 6 Feb 2009 15:13:06 +0800
From: Bryan Wu <cooloney@...nel.org>
To: dbrownell@...rs.sourceforge.net, akpm@...ux-foundation.org
Cc: spi-devel-general@...ts.sourceforge.net,
linux-kernel@...r.kernel.org,
Mike Frysinger <vapier.adi@...il.com>,
Bryan Wu <cooloney@...nel.org>
Subject: [PATCH 18/20] Blackfin SPI Driver: fix NULL pointer crash
From: Mike Frysinger <vapier.adi@...il.com>
fix NULL pointer crash when cleaning up from invalid platform resources
Signed-off-by: Mike Frysinger <vapier.adi@...il.com>
Signed-off-by: Bryan Wu <cooloney@...nel.org>
---
drivers/spi/spi_bfin5xx.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/drivers/spi/spi_bfin5xx.c b/drivers/spi/spi_bfin5xx.c
index f9e1fbc..9459c42 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]
--
1.5.6.3
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists