提交 ba77a562 编写于 作者: S Sergey Shtylyov 提交者: Zheng Zengkai

mmc: meson-mx-sdhc: add IRQ check

stable inclusion
from stable-v5.10.94
commit decb2099549d9618fb3483306843f0f3d74686d0
bugzilla: https://gitee.com/openeuler/kernel/issues/I531X9

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=decb2099549d9618fb3483306843f0f3d74686d0

--------------------------------

[ Upstream commit 77bed755 ]

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: e4bf1b09 ("mmc: host: meson-mx-sdhc: new driver for the Amlogic Meson SDHC host")
Signed-off-by: NSergey Shtylyov <s.shtylyov@omp.ru>
Reviewed-by: NMartin Blumenstingl <martin.blumenstingl@googlemail.com>
Link: https://lore.kernel.org/r/20211217202717.10041-2-s.shtylyov@omp.ruSigned-off-by: NUlf Hansson <ulf.hansson@linaro.org>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
Acked-by: NXie XiuQi <xiexiuqi@huawei.com>
上级 22f60829
...@@ -854,6 +854,11 @@ static int meson_mx_sdhc_probe(struct platform_device *pdev) ...@@ -854,6 +854,11 @@ static int meson_mx_sdhc_probe(struct platform_device *pdev)
goto err_disable_pclk; goto err_disable_pclk;
irq = platform_get_irq(pdev, 0); irq = platform_get_irq(pdev, 0);
if (irq < 0) {
ret = irq;
goto err_disable_pclk;
}
ret = devm_request_threaded_irq(dev, irq, meson_mx_sdhc_irq, ret = devm_request_threaded_irq(dev, irq, meson_mx_sdhc_irq,
meson_mx_sdhc_irq_thread, IRQF_ONESHOT, meson_mx_sdhc_irq_thread, IRQF_ONESHOT,
NULL, host); NULL, host);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册