spi: microchip-core: fix potentially incorrect return from probe
PATCH 1/1 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.
--- drivers/spi/spi-microchip-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/spi/spi-microchip-core.c +1 -1
@@ -541,7 +541,7 @@ static int mchp_corespi_probe(struct platform_device *pdev) spi->irq =platform_get_irq (pdev,0 );if (spi->irq <=0 ) {dev_err (&pdev->dev,"invalid IRQ %d for SPI controller\n" , spi->irq); - ret = spi->irq; + ret = -ENXIO ; goto error_release_master; }
Signature · 1 line
2.36.1
Quoted 6 lines · Conor Dooley
If
platform_get_irqi()returns 0, the error case will be triggered butprobe()will return 0 rather than an error. Ape the other drivers using this pattern and return-ENXIO.
Woops, forgot this one:
Quoted 18 lines
Signed-off-by Conor Dooley <[email protected]>--- drivers/spi/spi-microchip-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/spi/spi-microchip-core.c +1
-1@@ -541,7 +541,7 @@ static int mchp_corespi_probe(struct platform_device *pdev) spi->irq =platform_get_irq (pdev,0 );if (spi->irq <=0 ) {dev_err (&pdev->dev,"invalid IRQ %d for SPI controller\n" , spi->irq); - ret = spi->irq; + ret = -ENXIO ; goto error_release_master; }
Mark Brown
maintainerQuoted 5 lines · Conor Dooley
If
platform_get_irqi()returns 0, the error case will be triggered butprobe()will return 0 rather than an error. Ape the other drivers using this pattern and return-ENXIO.
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next
Thanks!
[1/1] spi: microchip-core: fix potentially incorrect return from probe
commit: d38dc01a4e68133e11ae74af7585d2c4bbd5803d
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark