Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

soc: fsl: cpm1: qmc: Set the ret error code on platform_get_irq() failure

A kernel test robot detected a missing error code:
qmc.c:1942 qmc_probe() warn: missing error code 'ret'

Indeed, the error returned by platform_get_irq() is checked and the
operation is aborted in case of failure but the ret error code is
not set in that case.

Set the ret error code.

Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Closes: https://lore.kernel.org/r/202411051350.KNy6ZIWA-lkp@intel.com/
Fixes: 3178d58e0b97 ("soc: fsl: cpm1: Add support for QMC")
Cc: stable@vger.kernel.org
Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Link: https://lore.kernel.org/r/20241105145623.401528-1-herve.codina@bootlin.com
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>

authored by

Herve Codina and committed by
Christophe Leroy
cb3daa51 c9f1efab

+3 -1
+3 -1
drivers/soc/fsl/qe/qmc.c
··· 2005 2005 2006 2006 /* Set the irq handler */ 2007 2007 irq = platform_get_irq(pdev, 0); 2008 - if (irq < 0) 2008 + if (irq < 0) { 2009 + ret = irq; 2009 2010 goto err_exit_xcc; 2011 + } 2010 2012 ret = devm_request_irq(qmc->dev, irq, qmc_irq_handler, 0, "qmc", qmc); 2011 2013 if (ret < 0) 2012 2014 goto err_exit_xcc;