public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH next] drm/panthor: unlock on error in panthor_ioctl_bo_create()
@ 2025-12-18  7:48 Dan Carpenter
  2025-12-18  8:55 ` Boris Brezillon
  2025-12-18 10:10 ` Boris Brezillon
  0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2025-12-18  7:48 UTC (permalink / raw)
  To: Loïc Molinari
  Cc: Boris Brezillon, Steven Price, Liviu Dudau, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
	dri-devel, linux-kernel, kernel-janitors

Call drm_dev_exit() before returning -EINVAL.

Fixes: cd2c9c3015e6 ("drm/panthor: Add flag to map GEM object Write-Back Cacheable")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
 drivers/gpu/drm/panthor/panthor_drv.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/panthor/panthor_drv.c b/drivers/gpu/drm/panthor/panthor_drv.c
index 98d4e8d867ed..165dddfde6ca 100644
--- a/drivers/gpu/drm/panthor/panthor_drv.c
+++ b/drivers/gpu/drm/panthor/panthor_drv.c
@@ -923,8 +923,10 @@ static int panthor_ioctl_bo_create(struct drm_device *ddev, void *data,
 	}
 
 	if ((args->flags & DRM_PANTHOR_BO_NO_MMAP) &&
-	    (args->flags & DRM_PANTHOR_BO_WB_MMAP))
-		return -EINVAL;
+	    (args->flags & DRM_PANTHOR_BO_WB_MMAP)) {
+		ret = -EINVAL;
+		goto out_dev_exit;
+	}
 
 	if (args->exclusive_vm_id) {
 		vm = panthor_vm_pool_get_vm(pfile->vms, args->exclusive_vm_id);
-- 
2.51.0


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

* Re: [PATCH next] drm/panthor: unlock on error in panthor_ioctl_bo_create()
  2025-12-18  7:48 [PATCH next] drm/panthor: unlock on error in panthor_ioctl_bo_create() Dan Carpenter
@ 2025-12-18  8:55 ` Boris Brezillon
  2025-12-18 10:10 ` Boris Brezillon
  1 sibling, 0 replies; 3+ messages in thread
From: Boris Brezillon @ 2025-12-18  8:55 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Loïc Molinari, Steven Price, Liviu Dudau, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
	dri-devel, linux-kernel, kernel-janitors

On Thu, 18 Dec 2025 10:48:22 +0300
Dan Carpenter <dan.carpenter@linaro.org> wrote:

> Call drm_dev_exit() before returning -EINVAL.

Oops.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>

> 
> Fixes: cd2c9c3015e6 ("drm/panthor: Add flag to map GEM object Write-Back Cacheable")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
> ---
>  drivers/gpu/drm/panthor/panthor_drv.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/panthor/panthor_drv.c b/drivers/gpu/drm/panthor/panthor_drv.c
> index 98d4e8d867ed..165dddfde6ca 100644
> --- a/drivers/gpu/drm/panthor/panthor_drv.c
> +++ b/drivers/gpu/drm/panthor/panthor_drv.c
> @@ -923,8 +923,10 @@ static int panthor_ioctl_bo_create(struct drm_device *ddev, void *data,
>  	}
>  
>  	if ((args->flags & DRM_PANTHOR_BO_NO_MMAP) &&
> -	    (args->flags & DRM_PANTHOR_BO_WB_MMAP))
> -		return -EINVAL;
> +	    (args->flags & DRM_PANTHOR_BO_WB_MMAP)) {
> +		ret = -EINVAL;
> +		goto out_dev_exit;
> +	}
>  
>  	if (args->exclusive_vm_id) {
>  		vm = panthor_vm_pool_get_vm(pfile->vms, args->exclusive_vm_id);


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

* Re: [PATCH next] drm/panthor: unlock on error in panthor_ioctl_bo_create()
  2025-12-18  7:48 [PATCH next] drm/panthor: unlock on error in panthor_ioctl_bo_create() Dan Carpenter
  2025-12-18  8:55 ` Boris Brezillon
@ 2025-12-18 10:10 ` Boris Brezillon
  1 sibling, 0 replies; 3+ messages in thread
From: Boris Brezillon @ 2025-12-18 10:10 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Loïc Molinari, Steven Price, Liviu Dudau, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
	dri-devel, linux-kernel, kernel-janitors

On Thu, 18 Dec 2025 10:48:22 +0300
Dan Carpenter <dan.carpenter@linaro.org> wrote:

> Call drm_dev_exit() before returning -EINVAL.
> 
> Fixes: cd2c9c3015e6 ("drm/panthor: Add flag to map GEM object Write-Back Cacheable")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>

Queued to drm-misc-next.

> ---
>  drivers/gpu/drm/panthor/panthor_drv.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/panthor/panthor_drv.c b/drivers/gpu/drm/panthor/panthor_drv.c
> index 98d4e8d867ed..165dddfde6ca 100644
> --- a/drivers/gpu/drm/panthor/panthor_drv.c
> +++ b/drivers/gpu/drm/panthor/panthor_drv.c
> @@ -923,8 +923,10 @@ static int panthor_ioctl_bo_create(struct drm_device *ddev, void *data,
>  	}
>  
>  	if ((args->flags & DRM_PANTHOR_BO_NO_MMAP) &&
> -	    (args->flags & DRM_PANTHOR_BO_WB_MMAP))
> -		return -EINVAL;
> +	    (args->flags & DRM_PANTHOR_BO_WB_MMAP)) {
> +		ret = -EINVAL;
> +		goto out_dev_exit;
> +	}
>  
>  	if (args->exclusive_vm_id) {
>  		vm = panthor_vm_pool_get_vm(pfile->vms, args->exclusive_vm_id);


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

end of thread, other threads:[~2025-12-18 10:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-18  7:48 [PATCH next] drm/panthor: unlock on error in panthor_ioctl_bo_create() Dan Carpenter
2025-12-18  8:55 ` Boris Brezillon
2025-12-18 10:10 ` Boris Brezillon

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