Skip to content

Commit d38dc01

Browse files
ConchuODbroonie
authored andcommitted
spi: microchip-core: fix potentially incorrect return from probe
If platform_get_irqi() returns 0, the error case will be triggered but probe() will return 0 rather than an error. Ape the other drivers using this pattern and return -ENXIO. Reported-by: Yang Li <yang.lee@linux.alibaba.com> Link: https://lore.kernel.org/linux-spi/20220609055533.95866-2-yang.lee@linux.alibaba.com/ Signed-off-by: Conor Dooley <conor.dooley@microchip.com> Fixes: 9ac8d17 ("spi: add support for microchip fpga spi controllers") Link: https://lore.kernel.org/r/20220614065809.1969177-1-conor.dooley@microchip.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 35f2b9a commit d38dc01

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/spi/spi-microchip-core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -541,7 +541,7 @@ static int mchp_corespi_probe(struct platform_device *pdev)
541541
spi->irq = platform_get_irq(pdev, 0);
542542
if (spi->irq <= 0) {
543543
dev_err(&pdev->dev, "invalid IRQ %d for SPI controller\n", spi->irq);
544-
ret = spi->irq;
544+
ret = -ENXIO;
545545
goto error_release_master;
546546
}
547547

0 commit comments

Comments
 (0)