diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2021-04-23 21:24:28 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2021-05-10 13:17:09 +0100 |
commit | f2eed8caa336e31d672804a8725dadba0415f19d (patch) | |
tree | 5676594ea724ab74887cb1053522d4287d5ae330 | |
parent | ccef8441fb2d352fa982f6607f471cdd17b30741 (diff) | |
download | linux-stable-f2eed8caa336e31d672804a8725dadba0415f19d.tar.gz linux-stable-f2eed8caa336e31d672804a8725dadba0415f19d.tar.bz2 linux-stable-f2eed8caa336e31d672804a8725dadba0415f19d.zip |
spi: pxa2xx: Use one point of return when ->probe() fails
When we can't allocate SPI controller, jump to the error path rather than
return locally.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20210423182441.50272-2-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r-- | drivers/spi/spi-pxa2xx.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/spi/spi-pxa2xx.c b/drivers/spi/spi-pxa2xx.c index 5e59ba075bc7..2f5618883ac3 100644 --- a/drivers/spi/spi-pxa2xx.c +++ b/drivers/spi/spi-pxa2xx.c @@ -1705,8 +1705,8 @@ static int pxa2xx_spi_probe(struct platform_device *pdev) if (!controller) { dev_err(&pdev->dev, "cannot alloc spi_controller\n"); - pxa_ssp_free(ssp); - return -ENOMEM; + status = -ENOMEM; + goto out_error_controller_alloc; } drv_data = spi_controller_get_devdata(controller); drv_data->controller = controller; |