summaryrefslogtreecommitdiff
path: root/drivers/spi/spi-meson-spicc.c
diff options
context:
space:
mode:
authorMiaoqian Lin <linmq006@gmail.com>2022-01-26 14:04:47 +0300
committerMark Brown <broonie@kernel.org>2022-01-26 16:32:36 +0300
commite937440f7fc444a3e3f1fb75ea65292d6f433a44 (patch)
treee65ffca022ce791fc5ee04bfc3f1e16ff517ab15 /drivers/spi/spi-meson-spicc.c
parent23e3404de1aecc62c14ac96d4b63403c3e0f52d5 (diff)
downloadlinux-e937440f7fc444a3e3f1fb75ea65292d6f433a44.tar.xz
spi: meson-spicc: add IRQ check in meson_spicc_probe
This check misses checking for platform_get_irq()'s call and may passes the negative error codes to devm_request_irq(), which takes unsigned IRQ #, causing it to fail with -EINVAL, overriding an original error code. Stop calling devm_request_irq() with invalid IRQ #s. Fixes: 454fa271bc4e ("spi: Add Meson SPICC driver") Signed-off-by: Miaoqian Lin <linmq006@gmail.com> Link: https://lore.kernel.org/r/20220126110447.24549-1-linmq006@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi/spi-meson-spicc.c')
-rw-r--r--drivers/spi/spi-meson-spicc.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/spi/spi-meson-spicc.c b/drivers/spi/spi-meson-spicc.c
index c208efeadd18..0bc7daa7afc8 100644
--- a/drivers/spi/spi-meson-spicc.c
+++ b/drivers/spi/spi-meson-spicc.c
@@ -693,6 +693,11 @@ static int meson_spicc_probe(struct platform_device *pdev)
writel_relaxed(0, spicc->base + SPICC_INTREG);
irq = platform_get_irq(pdev, 0);
+ if (irq < 0) {
+ ret = irq;
+ goto out_master;
+ }
+
ret = devm_request_irq(&pdev->dev, irq, meson_spicc_irq,
0, NULL, spicc);
if (ret) {