Skip to content

Commit

Permalink
mmc: meson-mx-sdio: add IRQ check
Browse files Browse the repository at this point in the history
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: ed80a13 ("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>
  • Loading branch information
Sergey Shtylyov authored and Ulf Hansson committed Dec 21, 2021
1 parent 77bed75 commit 8fc9a77
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/mmc/host/meson-mx-sdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 8fc9a77

Please sign in to comment.