* [PATCH 0/2] Add IRQ check to the Meson MMC/SD drivers
@ 2021-12-17 20:27 Sergey Shtylyov
2021-12-17 20:27 ` [PATCH 1/2] mmc: meson-mx-sdhc: add IRQ check Sergey Shtylyov
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Sergey Shtylyov @ 2021-12-17 20:27 UTC (permalink / raw)
To: Ulf Hansson, linux-mmc
Cc: Neil Armstrong, Kevin Hilman, Jerome Brunet, Martin Blumenstingl,
linux-arm-kernel, linux-amlogic
Here are 2 patches against the 'fixes' branch of Ulf Hansson's 'mmc.git' repo.
The affected drivers call platform_get_irq() but forget to check for the error
case and blithely pass the negative error codes to devm_request_threaded_irq()
(which takes *unsigned* IRQ #). Now stop calling devm_request_threaded_irq()
with the invalid IRQ #s!
Sergey Shtylyov (2):
mmc: meson-mx-sdhc: add IRQ check
mmc: meson-mx-sdio: add IRQ check
drivers/mmc/host/meson-mx-sdhc-mmc.c | 5 +++++
drivers/mmc/host/meson-mx-sdio.c | 5 +++++
2 files changed, 10 insertions(+)
--
2.26.3
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/2] mmc: meson-mx-sdhc: add IRQ check
2021-12-17 20:27 [PATCH 0/2] Add IRQ check to the Meson MMC/SD drivers Sergey Shtylyov
@ 2021-12-17 20:27 ` Sergey Shtylyov
2021-12-18 23:21 ` Martin Blumenstingl
2021-12-17 20:27 ` [PATCH 2/2] mmc: meson-mx-sdio: " Sergey Shtylyov
2021-12-21 13:03 ` [PATCH 0/2] Add IRQ check to the Meson MMC/SD drivers Ulf Hansson
2 siblings, 1 reply; 6+ messages in thread
From: Sergey Shtylyov @ 2021-12-17 20:27 UTC (permalink / raw)
To: Ulf Hansson, linux-mmc
Cc: Neil Armstrong, Kevin Hilman, Jerome Brunet, Martin Blumenstingl,
linux-arm-kernel, linux-amlogic
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>
---
drivers/mmc/host/meson-mx-sdhc-mmc.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/mmc/host/meson-mx-sdhc-mmc.c b/drivers/mmc/host/meson-mx-sdhc-mmc.c
index 7cd9c0ec2fcf..b6a1f25903a2 100644
--- a/drivers/mmc/host/meson-mx-sdhc-mmc.c
+++ b/drivers/mmc/host/meson-mx-sdhc-mmc.c
@@ -838,6 +838,11 @@ static int meson_mx_sdhc_probe(struct platform_device *pdev)
goto err_disable_pclk;
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,
meson_mx_sdhc_irq_thread, IRQF_ONESHOT,
NULL, host);
--
2.26.3
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/2] mmc: meson-mx-sdio: add IRQ check
2021-12-17 20:27 [PATCH 0/2] Add IRQ check to the Meson MMC/SD drivers Sergey Shtylyov
2021-12-17 20:27 ` [PATCH 1/2] mmc: meson-mx-sdhc: add IRQ check Sergey Shtylyov
@ 2021-12-17 20:27 ` Sergey Shtylyov
2021-12-18 23:21 ` Martin Blumenstingl
2021-12-21 13:03 ` [PATCH 0/2] Add IRQ check to the Meson MMC/SD drivers Ulf Hansson
2 siblings, 1 reply; 6+ messages in thread
From: Sergey Shtylyov @ 2021-12-17 20:27 UTC (permalink / raw)
To: Ulf Hansson, linux-mmc
Cc: Neil Armstrong, Kevin Hilman, Jerome Brunet, Martin Blumenstingl,
linux-arm-kernel, linux-amlogic
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>
---
drivers/mmc/host/meson-mx-sdio.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/mmc/host/meson-mx-sdio.c b/drivers/mmc/host/meson-mx-sdio.c
index d4a48916bfb6..3a19a05ef55a 100644
--- a/drivers/mmc/host/meson-mx-sdio.c
+++ b/drivers/mmc/host/meson-mx-sdio.c
@@ -662,6 +662,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,
--
2.26.3
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] mmc: meson-mx-sdhc: add IRQ check
2021-12-17 20:27 ` [PATCH 1/2] mmc: meson-mx-sdhc: add IRQ check Sergey Shtylyov
@ 2021-12-18 23:21 ` Martin Blumenstingl
0 siblings, 0 replies; 6+ messages in thread
From: Martin Blumenstingl @ 2021-12-18 23:21 UTC (permalink / raw)
To: Sergey Shtylyov
Cc: Ulf Hansson, linux-mmc, Neil Armstrong, Kevin Hilman,
Jerome Brunet, linux-arm-kernel, linux-amlogic
On Fri, Dec 17, 2021 at 9:27 PM Sergey Shtylyov <s.shtylyov@omp.ru> wrote:
>
> 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>
Thank you for catching this and for submitting a fix!
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 2/2] mmc: meson-mx-sdio: add IRQ check
2021-12-17 20:27 ` [PATCH 2/2] mmc: meson-mx-sdio: " Sergey Shtylyov
@ 2021-12-18 23:21 ` Martin Blumenstingl
0 siblings, 0 replies; 6+ messages in thread
From: Martin Blumenstingl @ 2021-12-18 23:21 UTC (permalink / raw)
To: Sergey Shtylyov
Cc: Ulf Hansson, linux-mmc, Neil Armstrong, Kevin Hilman,
Jerome Brunet, linux-arm-kernel, linux-amlogic
On Fri, Dec 17, 2021 at 9:27 PM Sergey Shtylyov <s.shtylyov@omp.ru> wrote:
>
> 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>
Thank you for catching this and for submitting a fix!
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 0/2] Add IRQ check to the Meson MMC/SD drivers
2021-12-17 20:27 [PATCH 0/2] Add IRQ check to the Meson MMC/SD drivers Sergey Shtylyov
2021-12-17 20:27 ` [PATCH 1/2] mmc: meson-mx-sdhc: add IRQ check Sergey Shtylyov
2021-12-17 20:27 ` [PATCH 2/2] mmc: meson-mx-sdio: " Sergey Shtylyov
@ 2021-12-21 13:03 ` Ulf Hansson
2 siblings, 0 replies; 6+ messages in thread
From: Ulf Hansson @ 2021-12-21 13:03 UTC (permalink / raw)
To: Sergey Shtylyov
Cc: linux-mmc, Neil Armstrong, Kevin Hilman, Jerome Brunet,
Martin Blumenstingl, linux-arm-kernel, linux-amlogic
On Fri, 17 Dec 2021 at 21:27, Sergey Shtylyov <s.shtylyov@omp.ru> wrote:
>
> Here are 2 patches against the 'fixes' branch of Ulf Hansson's 'mmc.git' repo.
> The affected drivers call platform_get_irq() but forget to check for the error
> case and blithely pass the negative error codes to devm_request_threaded_irq()
> (which takes *unsigned* IRQ #). Now stop calling devm_request_threaded_irq()
> with the invalid IRQ #s!
>
> Sergey Shtylyov (2):
> mmc: meson-mx-sdhc: add IRQ check
> mmc: meson-mx-sdio: add IRQ check
>
> drivers/mmc/host/meson-mx-sdhc-mmc.c | 5 +++++
> drivers/mmc/host/meson-mx-sdio.c | 5 +++++
> 2 files changed, 10 insertions(+)
>
Applied for next, thanks!
Kind regards
Uffe
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2021-12-21 13:06 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-17 20:27 [PATCH 0/2] Add IRQ check to the Meson MMC/SD drivers Sergey Shtylyov
2021-12-17 20:27 ` [PATCH 1/2] mmc: meson-mx-sdhc: add IRQ check Sergey Shtylyov
2021-12-18 23:21 ` Martin Blumenstingl
2021-12-17 20:27 ` [PATCH 2/2] mmc: meson-mx-sdio: " Sergey Shtylyov
2021-12-18 23:21 ` Martin Blumenstingl
2021-12-21 13:03 ` [PATCH 0/2] Add IRQ check to the Meson MMC/SD drivers Ulf Hansson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).