summaryrefslogtreecommitdiff
path: root/drivers/spi/spi-pxa2xx.c
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2021-06-01 18:33:33 +0100
committerMark Brown <broonie@kernel.org>2021-06-01 18:33:33 +0100
commit1a435466b0d470eb9095da0efefea5f7f69acf9c (patch)
treea661a705f8236cf7bd86ff250de2f627c9f0a333 /drivers/spi/spi-pxa2xx.c
parent5cb4e1f33e5eeadbce3814282e010d4dd31816af (diff)
parent2ec6f20b33eb4f62ab90bdcd620436c883ec3af6 (diff)
Merge branch 'for-5.13' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi into spi-5.14
Diffstat (limited to 'drivers/spi/spi-pxa2xx.c')
-rw-r--r--drivers/spi/spi-pxa2xx.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/spi/spi-pxa2xx.c b/drivers/spi/spi-pxa2xx.c
index bdf9a283efc3..974e30744b83 100644
--- a/drivers/spi/spi-pxa2xx.c
+++ b/drivers/spi/spi-pxa2xx.c
@@ -1250,6 +1250,7 @@ static int setup(struct spi_device *spi)
struct driver_data *drv_data =
spi_controller_get_devdata(spi->controller);
uint tx_thres, tx_hi_thres, rx_thres;
+ int err;
switch (drv_data->ssp_type) {
case QUARK_X1000_SSP:
@@ -1410,7 +1411,11 @@ static int setup(struct spi_device *spi)
if (drv_data->ssp_type == CE4100_SSP)
return 0;
- return setup_cs(spi, chip, chip_info);
+ err = setup_cs(spi, chip, chip_info);
+ if (err)
+ kfree(chip);
+
+ return err;
}
static void cleanup(struct spi_device *spi)