linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] powerpc/fsl_msi: fix return error value in error handing path
@ 2022-04-25  2:41 cgel.zte
  2022-09-27 14:35 ` Michael Ellerman
  0 siblings, 1 reply; 2+ messages in thread
From: cgel.zte @ 2022-04-25  2:41 UTC (permalink / raw)
  To: mpe, benh
  Cc: maz, lv.ruyi, linux-kernel, jgg, paulus, tglx, linuxppc-dev, Zeal Robot

From: Lv Ruyi <lv.ruyi@zte.com.cn>

This function fsl_msi_setup_hwirq() seems to return zero on success and
non-zero on failure, but it returns zero in error handing path.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Lv Ruyi <lv.ruyi@zte.com.cn>
---
 arch/powerpc/sysdev/fsl_msi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/sysdev/fsl_msi.c b/arch/powerpc/sysdev/fsl_msi.c
index b3475ae9f236..10f974cfa2f3 100644
--- a/arch/powerpc/sysdev/fsl_msi.c
+++ b/arch/powerpc/sysdev/fsl_msi.c
@@ -353,7 +353,7 @@ static int fsl_msi_setup_hwirq(struct fsl_msi *msi, struct platform_device *dev,
 	if (!virt_msir) {
 		dev_err(&dev->dev, "%s: Cannot translate IRQ index %d\n",
 			__func__, irq_index);
-		return 0;
+		return -EINVAL;
 	}
 
 	cascade_data = kzalloc(sizeof(struct fsl_msi_cascade_data), GFP_KERNEL);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] powerpc/fsl_msi: fix return error value in error handing path
  2022-04-25  2:41 [PATCH] powerpc/fsl_msi: fix return error value in error handing path cgel.zte
@ 2022-09-27 14:35 ` Michael Ellerman
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Ellerman @ 2022-09-27 14:35 UTC (permalink / raw)
  To: cgel.zte, benh
  Cc: maz, lv.ruyi, linux-kernel, jgg, paulus, tglx, linuxppc-dev, Zeal Robot

cgel.zte@gmail.com writes:
> From: Lv Ruyi <lv.ruyi@zte.com.cn>
>
> This function fsl_msi_setup_hwirq() seems to return zero on success and
> non-zero on failure, but it returns zero in error handing path.

I agree it seems wrong, but I can't be sure the current code is wrong,
so unless you're able to test this on actual hardware (or qemu), I'll
drop this patch.

cheers

> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: Lv Ruyi <lv.ruyi@zte.com.cn>
> ---
>  arch/powerpc/sysdev/fsl_msi.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/powerpc/sysdev/fsl_msi.c b/arch/powerpc/sysdev/fsl_msi.c
> index b3475ae9f236..10f974cfa2f3 100644
> --- a/arch/powerpc/sysdev/fsl_msi.c
> +++ b/arch/powerpc/sysdev/fsl_msi.c
> @@ -353,7 +353,7 @@ static int fsl_msi_setup_hwirq(struct fsl_msi *msi, struct platform_device *dev,
>  	if (!virt_msir) {
>  		dev_err(&dev->dev, "%s: Cannot translate IRQ index %d\n",
>  			__func__, irq_index);
> -		return 0;
> +		return -EINVAL;
>  	}
>  
>  	cascade_data = kzalloc(sizeof(struct fsl_msi_cascade_data), GFP_KERNEL);
> -- 
> 2.25.1

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-09-27 14:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-25  2:41 [PATCH] powerpc/fsl_msi: fix return error value in error handing path cgel.zte
2022-09-27 14:35 ` Michael Ellerman

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).