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]>
drivers/spi/pxa2xx_spi.c +3 -0
@@ -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);
Signature · 1 line
Daniel Ribeiro