mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] drm/pl111: Fix missing unwind goto in pl111_amba_probe()
@ 2023-03-29 17:18 Harshit Mogalapalli
  2023-07-19 21:04 ` Javier Martinez Canillas
  0 siblings, 1 reply; 2+ messages in thread
From: Harshit Mogalapalli @ 2023-03-29 17:18 UTC (permalink / raw)
  To: emma, eric, tom.cooksey
  Cc: error27, daniel, airlied, linus.walleij, dri-devel, linux-kernel,
	Harshit Mogalapalli

Smatch reports:
	drivers/gpu/drm/pl111/pl111_drv.c:300
	pl111_amba_probe() warn: missing unwind goto?

When devm_request_irq() returns non-zero value, we need to drop the
reference for drm device and also release reserved memory which is
done in "dev_put" label. So instead of directly returning, goto dev_put
to fix this bug.

Fixes: bed41005e617 ("drm/pl111: Initial drm/kms driver for pl111")
Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
---
This is based on static analysis, Only Compile tested.
---
 drivers/gpu/drm/pl111/pl111_drv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/pl111/pl111_drv.c b/drivers/gpu/drm/pl111/pl111_drv.c
index 4b2a9e9753f6..72c5d3681b47 100644
--- a/drivers/gpu/drm/pl111/pl111_drv.c
+++ b/drivers/gpu/drm/pl111/pl111_drv.c
@@ -297,7 +297,7 @@ static int pl111_amba_probe(struct amba_device *amba_dev,
 			       variant->name, priv);
 	if (ret != 0) {
 		dev_err(dev, "%s failed irq %d\n", __func__, ret);
-		return ret;
+		goto dev_put;
 	}
 
 	ret = pl111_modeset_init(drm);
-- 
2.38.1


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

* Re: [PATCH] drm/pl111: Fix missing unwind goto in pl111_amba_probe()
  2023-03-29 17:18 [PATCH] drm/pl111: Fix missing unwind goto in pl111_amba_probe() Harshit Mogalapalli
@ 2023-07-19 21:04 ` Javier Martinez Canillas
  0 siblings, 0 replies; 2+ messages in thread
From: Javier Martinez Canillas @ 2023-07-19 21:04 UTC (permalink / raw)
  To: Harshit Mogalapalli, emma, eric, tom.cooksey
  Cc: error27, linux-kernel, dri-devel, Harshit Mogalapalli

Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com> writes:

> Smatch reports:
> 	drivers/gpu/drm/pl111/pl111_drv.c:300
> 	pl111_amba_probe() warn: missing unwind goto?
>
> When devm_request_irq() returns non-zero value, we need to drop the
> reference for drm device and also release reserved memory which is
> done in "dev_put" label. So instead of directly returning, goto dev_put
> to fix this bug.
>
> Fixes: bed41005e617 ("drm/pl111: Initial drm/kms driver for pl111")
> Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
> ---
> This is based on static analysis, Only Compile tested.
> ---
>  drivers/gpu/drm/pl111/pl111_drv.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

The patch looks correct to me.

Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>

-- 
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat


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

end of thread, other threads:[~2023-07-19 21:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-29 17:18 [PATCH] drm/pl111: Fix missing unwind goto in pl111_amba_probe() Harshit Mogalapalli
2023-07-19 21:04 ` Javier Martinez Canillas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®