mmc: meson-mx-sdhc: add IRQ check
authorSergey Shtylyov <s.shtylyov@omp.ru>
Fri, 17 Dec 2021 20:27:16 +0000 (23:27 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 27 Jan 2022 09:53:58 +0000 (10:53 +0100)
commitdecb2099549d9618fb3483306843f0f3d74686d0
tree9898fb144343d24920802c511257f5385cd65e48
parentbdc6c9fc5f78abbbf329139e4decb104ddd96e47
mmc: meson-mx-sdhc: add IRQ check

[ Upstream commit 77bed755e0f06135faccdd3948863703f9a6e640 ]

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: e4bf1b0970ef ("mmc: host: meson-mx-sdhc: new driver for the Amlogic Meson SDHC host")
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-2-s.shtylyov@omp.ru
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/mmc/host/meson-mx-sdhc-mmc.c