mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
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]>
This commit is contained in:
parent
816dc3c82b
commit
7348d82a67
1 changed files with 3 additions and 0 deletions
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue