diff options
author | Mark Brown <broonie@kernel.org> | 2021-06-01 20:33:33 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2021-06-01 20:33:33 +0300 |
commit | 1a435466b0d470eb9095da0efefea5f7f69acf9c (patch) | |
tree | a661a705f8236cf7bd86ff250de2f627c9f0a333 /drivers/spi/spi-omap-uwire.c | |
parent | 5cb4e1f33e5eeadbce3814282e010d4dd31816af (diff) | |
parent | 2ec6f20b33eb4f62ab90bdcd620436c883ec3af6 (diff) | |
download | linux-1a435466b0d470eb9095da0efefea5f7f69acf9c.tar.xz |
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-omap-uwire.c')
-rw-r--r-- | drivers/spi/spi-omap-uwire.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/spi/spi-omap-uwire.c b/drivers/spi/spi-omap-uwire.c index c975e8640560..087172a193fa 100644 --- a/drivers/spi/spi-omap-uwire.c +++ b/drivers/spi/spi-omap-uwire.c @@ -424,15 +424,22 @@ done: static int uwire_setup(struct spi_device *spi) { struct uwire_state *ust = spi->controller_state; + bool initial_setup = false; + int status; if (ust == NULL) { ust = kzalloc(sizeof(*ust), GFP_KERNEL); if (ust == NULL) return -ENOMEM; spi->controller_state = ust; + initial_setup = true; } - return uwire_setup_transfer(spi, NULL); + status = uwire_setup_transfer(spi, NULL); + if (status && initial_setup) + kfree(ust); + + return status; } static void uwire_cleanup(struct spi_device *spi) |