diff options
author | Daniel Ribeiro <[email protected]> | 2009-05-12 13:19:36 -0700 |
---|---|---|
committer | Linus Torvalds <[email protected]> | 2009-05-12 14:11:34 -0700 |
commit | 7348d82a67b3fe0363e7f0679b50ecbdc65116c7 (patch) | |
tree | ed0f3029a4eaf8b2ec6149214f2191390ff2c377 | |
parent | 816dc3c82b34f709dc1c29ea0a6f417d739a3487 (diff) |
pxa2xx_spi: prevent panic case setup() fails
setup() may fail before ctldata is set, causing a kernel panic on
cleanup().
Signed-off-by: Daniel Ribeiro <[email protected]>
Signed-off-by: David Brownell <[email protected]>
Cc: Eric Miao <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
-rw-r--r-- | drivers/spi/pxa2xx_spi.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/spi/pxa2xx_spi.c b/drivers/spi/pxa2xx_spi.c index 885194a07418..3f3c08c6ba4e 100644 --- a/drivers/spi/pxa2xx_spi.c +++ b/drivers/spi/pxa2xx_spi.c @@ -1373,6 +1373,9 @@ static void cleanup(struct spi_device *spi) { struct chip_data *chip = spi_get_ctldata(spi); + if (!chip) + return; + if (gpio_is_valid(chip->gpio_cs)) gpio_free(chip->gpio_cs); |