mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-03-06 03:39:19 -05:00
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>
This commit is contained in:
committed by
Mark Brown
parent
ccef8441fb
commit
f2eed8caa3
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user