diff options
author | Sergey Shtylyov <s.shtylyov@omp.ru> | 2021-12-17 23:27:17 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-01-27 09:04:20 +0100 |
commit | 27b198a8601a952383b6b64e1024621f63ba8fa8 (patch) | |
tree | 2c5dc8ad85908328231dcca636cb01a1e560e862 | |
parent | b1e915d40729455a4e7295fdc3e2b0f403bc7122 (diff) | |
download | linux-stable-27b198a8601a952383b6b64e1024621f63ba8fa8.tar.gz linux-stable-27b198a8601a952383b6b64e1024621f63ba8fa8.tar.bz2 linux-stable-27b198a8601a952383b6b64e1024621f63ba8fa8.zip |
mmc: meson-mx-sdio: add IRQ check
[ Upstream commit 8fc9a77bc64e1f23d07953439817d8402ac9706f ]
The driver neglects to check the result of platform_get_irq()'s call and
blithely passes the negative error codes to devm_request_threaded_irq()
(which takes *unsigned* IRQ #), causing it to fail with -EINVAL, overriding
an original error code. Stop calling devm_request_threaded_irq() with the
invalid IRQ #s.
Fixes: ed80a13bb4c4 ("mmc: meson-mx-sdio: Add a driver for the Amlogic Meson8 and Meson8b SoC")
Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
Reviewed-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Link: https://lore.kernel.org/r/20211217202717.10041-3-s.shtylyov@omp.ru
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r-- | drivers/mmc/host/meson-mx-sdio.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/mmc/host/meson-mx-sdio.c b/drivers/mmc/host/meson-mx-sdio.c index 27837a794e7b..1f7e4352b067 100644 --- a/drivers/mmc/host/meson-mx-sdio.c +++ b/drivers/mmc/host/meson-mx-sdio.c @@ -668,6 +668,11 @@ static int meson_mx_mmc_probe(struct platform_device *pdev) } irq = platform_get_irq(pdev, 0); + if (irq < 0) { + ret = irq; + goto error_free_mmc; + } + ret = devm_request_threaded_irq(host->controller_dev, irq, meson_mx_mmc_irq, meson_mx_mmc_irq_thread, IRQF_ONESHOT, |