mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] drm/xe/device: clean up on error in probe()
@ 2024-01-05 12:22 Dan Carpenter
  2024-01-05 20:31 ` Matthew Brost
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2024-01-05 12:22 UTC (permalink / raw)
  To: Himal Prasad Ghimiray
  Cc: Lucas De Marchi, Oded Gabbay, Thomas Hellström,
	Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	David Airlie, Daniel Vetter, Matt Roper, Rodrigo Vivi, intel-xe,
	dri-devel, linux-kernel, kernel-janitors

This error path should clean up before returning.

Smatch detected this bug:
  drivers/gpu/drm/xe/xe_device.c:487 xe_device_probe() warn: missing unwind goto?

Fixes: 4cb12b71923b ("drm/xe/xe2: Determine bios enablement for flat ccs on igfx")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
Speeking of static analysis, someone should probably run Sparse on this
driver.  There are some missing annotations.

drivers/gpu/drm/xe/xe_mmio.h:65:72: warning: incorrect type in argument 1 (different address spaces)
drivers/gpu/drm/xe/xe_mmio.h:65:72:    expected void const volatile [noderef] __iomem *addr
drivers/gpu/drm/xe/xe_mmio.h:65:72:    got void *

 drivers/gpu/drm/xe/xe_device.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/xe/xe_device.c b/drivers/gpu/drm/xe/xe_device.c
index d9ae77fe7382..b8d8da546670 100644
--- a/drivers/gpu/drm/xe/xe_device.c
+++ b/drivers/gpu/drm/xe/xe_device.c
@@ -484,7 +484,7 @@ int xe_device_probe(struct xe_device *xe)
 
 	err = xe_device_set_has_flat_ccs(xe);
 	if (err)
-		return err;
+		goto err_irq_shutdown;
 
 	err = xe_mmio_probe_vram(xe);
 	if (err)
-- 
2.42.0


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

* Re: [PATCH] drm/xe/device: clean up on error in probe()
  2024-01-05 12:22 [PATCH] drm/xe/device: clean up on error in probe() Dan Carpenter
@ 2024-01-05 20:31 ` Matthew Brost
  0 siblings, 0 replies; 2+ messages in thread
From: Matthew Brost @ 2024-01-05 20:31 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Himal Prasad Ghimiray, Matt Roper, Thomas Hellström,
	kernel-janitors, Lucas De Marchi, Oded Gabbay, linux-kernel,
	Maxime Ripard, dri-devel, Thomas Zimmermann, Rodrigo Vivi,
	intel-xe

On Fri, Jan 05, 2024 at 03:22:23PM +0300, Dan Carpenter wrote:
> This error path should clean up before returning.
> 
> Smatch detected this bug:
>   drivers/gpu/drm/xe/xe_device.c:487 xe_device_probe() warn: missing unwind goto?
> 
> Fixes: 4cb12b71923b ("drm/xe/xe2: Determine bios enablement for flat ccs on igfx")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>

Reviewed-by: Matthew Brost <matthew.brost@intel.com>

> ---
> Speeking of static analysis, someone should probably run Sparse on this
> driver.  There are some missing annotations.
> 
> drivers/gpu/drm/xe/xe_mmio.h:65:72: warning: incorrect type in argument 1 (different address spaces)
> drivers/gpu/drm/xe/xe_mmio.h:65:72:    expected void const volatile [noderef] __iomem *addr
> drivers/gpu/drm/xe/xe_mmio.h:65:72:    got void *
> 
>  drivers/gpu/drm/xe/xe_device.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_device.c b/drivers/gpu/drm/xe/xe_device.c
> index d9ae77fe7382..b8d8da546670 100644
> --- a/drivers/gpu/drm/xe/xe_device.c
> +++ b/drivers/gpu/drm/xe/xe_device.c
> @@ -484,7 +484,7 @@ int xe_device_probe(struct xe_device *xe)
>  
>  	err = xe_device_set_has_flat_ccs(xe);
>  	if (err)
> -		return err;
> +		goto err_irq_shutdown;
>  
>  	err = xe_mmio_probe_vram(xe);
>  	if (err)
> -- 
> 2.42.0
> 

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

end of thread, other threads:[~2024-01-05 20:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-05 12:22 [PATCH] drm/xe/device: clean up on error in probe() Dan Carpenter
2024-01-05 20:31 ` Matthew Brost

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®