diff options
Diffstat (limited to 'drivers/spi')
-rw-r--r-- | 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 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) | |||
1178 | { | 1178 | { |
1179 | struct chip_data *chip = spi_get_ctldata(spi); | 1179 | struct chip_data *chip = spi_get_ctldata(spi); |
1180 | 1180 | ||
1181 | if (!chip) | ||
1182 | return; | ||
1183 | |||
1181 | if ((chip->chip_select_num > 0) | 1184 | if ((chip->chip_select_num > 0) |
1182 | && (chip->chip_select_num <= spi->master->num_chipselect)) | 1185 | && (chip->chip_select_num <= spi->master->num_chipselect)) |
1183 | peripheral_free(ssel[spi->master->bus_num] | 1186 | peripheral_free(ssel[spi->master->bus_num] |