在 2024/11/20 19:05, Herve Codina 写道:
Hi Pei,

On Wed, 20 Nov 2024 17:38:20 +0800
Pei Xiao <[email protected]> wrote:

platform_get_irq() may failed,but ret still equals to 0,
will cacuse qmc_probe() return 0 but fail.

Reported-by: Dan Carpenter <[email protected]>
Closes: https://lore.kernel.org/r/[email protected]/
Fixes: 3178d58e0b97 ("soc: fsl: cpm1: Add support for QMC")
Signed-off-by: Pei Xiao <[email protected]>
---
  drivers/soc/fsl/qe/qmc.c | 4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/soc/fsl/qe/qmc.c b/drivers/soc/fsl/qe/qmc.c
index 19cc581b06d0..a78768cd6007 100644
--- a/drivers/soc/fsl/qe/qmc.c
+++ b/drivers/soc/fsl/qe/qmc.c
@@ -2004,8 +2004,10 @@ static int qmc_probe(struct platform_device *pdev)
/* Set the irq handler */
        irq = platform_get_irq(pdev, 0);
-       if (irq < 0)
+       if (irq < 0) {
+               ret = -EINVAL;
                goto err_exit_xcc;
+       }
        ret = devm_request_irq(qmc->dev, irq, qmc_irq_handler, 0, "qmc", qmc);
        if (ret < 0)
                goto err_exit_xcc;

I already send a fix:
https://lore.kernel.org/all/[email protected]/


ok, I'm so sorry for send repeated patch.

Tnanks!
Pei.
And it is available in the following PR done by Christophe:
https://lore.kernel.org/all/[email protected]/

Best regards,
Hervé

Reply via email to