LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] drm/panfrost: Only put sync_out if non-NULL
       [not found] <20190507080405.GA9436@mwanda>
@ 2019-05-09  8:21 ` Tomeu Vizoso
  2019-05-09 16:22   ` Steven Price
  2019-05-13 14:56   ` Rob Herring
  0 siblings, 2 replies; 3+ messages in thread
From: Tomeu Vizoso @ 2019-05-09  8:21 UTC (permalink / raw)
  To: LKML
  Cc: Tomeu Vizoso, Dan Carpenter, Rob Herring, David Airlie,
	Daniel Vetter, dri-devel

Dan Carpenter's static analysis tool reported:

drivers/gpu/drm/panfrost/panfrost_drv.c:222 panfrost_ioctl_submit()
error: we previously assumed 'sync_out' could be null (see line 216)

Indeed, sync_out could be NULL if userspace doesn't send a sync object
ID for the out fence.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lists.freedesktop.org/archives/dri-devel/2019-May/217014.html
---
 drivers/gpu/drm/panfrost/panfrost_drv.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/panfrost/panfrost_drv.c b/drivers/gpu/drm/panfrost/panfrost_drv.c
index 94b0819ad50b..d11e2281dde6 100644
--- a/drivers/gpu/drm/panfrost/panfrost_drv.c
+++ b/drivers/gpu/drm/panfrost/panfrost_drv.c
@@ -219,7 +219,8 @@ static int panfrost_ioctl_submit(struct drm_device *dev, void *data,
 fail_job:
 	panfrost_job_put(job);
 fail_out_sync:
-	drm_syncobj_put(sync_out);
+	if (sync_out)
+		drm_syncobj_put(sync_out);
 
 	return ret;
 }
-- 
2.20.1


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

* Re: [PATCH] drm/panfrost: Only put sync_out if non-NULL
  2019-05-09  8:21 ` [PATCH] drm/panfrost: Only put sync_out if non-NULL Tomeu Vizoso
@ 2019-05-09 16:22   ` Steven Price
  2019-05-13 14:56   ` Rob Herring
  1 sibling, 0 replies; 3+ messages in thread
From: Steven Price @ 2019-05-09 16:22 UTC (permalink / raw)
  To: Tomeu Vizoso, LKML; +Cc: David Airlie, dri-devel, Dan Carpenter

On 09/05/2019 09:21, Tomeu Vizoso wrote:
> Dan Carpenter's static analysis tool reported:
> 
> drivers/gpu/drm/panfrost/panfrost_drv.c:222 panfrost_ioctl_submit()
> error: we previously assumed 'sync_out' could be null (see line 216)
> 
> Indeed, sync_out could be NULL if userspace doesn't send a sync object
> ID for the out fence.
> 
> Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
> Link: https://lists.freedesktop.org/archives/dri-devel/2019-May/217014.html

Reviewed-by: Steven Price <steven.price@arm.com>

> ---
>  drivers/gpu/drm/panfrost/panfrost_drv.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/panfrost/panfrost_drv.c b/drivers/gpu/drm/panfrost/panfrost_drv.c
> index 94b0819ad50b..d11e2281dde6 100644
> --- a/drivers/gpu/drm/panfrost/panfrost_drv.c
> +++ b/drivers/gpu/drm/panfrost/panfrost_drv.c
> @@ -219,7 +219,8 @@ static int panfrost_ioctl_submit(struct drm_device *dev, void *data,
>  fail_job:
>  	panfrost_job_put(job);
>  fail_out_sync:
> -	drm_syncobj_put(sync_out);
> +	if (sync_out)
> +		drm_syncobj_put(sync_out);
>  
>  	return ret;
>  }
> 


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

* Re: [PATCH] drm/panfrost: Only put sync_out if non-NULL
  2019-05-09  8:21 ` [PATCH] drm/panfrost: Only put sync_out if non-NULL Tomeu Vizoso
  2019-05-09 16:22   ` Steven Price
@ 2019-05-13 14:56   ` Rob Herring
  1 sibling, 0 replies; 3+ messages in thread
From: Rob Herring @ 2019-05-13 14:56 UTC (permalink / raw)
  To: Tomeu Vizoso; +Cc: LKML, Dan Carpenter, David Airlie, Daniel Vetter, dri-devel

On Thu, May 9, 2019 at 3:22 AM Tomeu Vizoso <tomeu.vizoso@collabora.com> wrote:
>
> Dan Carpenter's static analysis tool reported:
>
> drivers/gpu/drm/panfrost/panfrost_drv.c:222 panfrost_ioctl_submit()
> error: we previously assumed 'sync_out' could be null (see line 216)
>
> Indeed, sync_out could be NULL if userspace doesn't send a sync object
> ID for the out fence.
>
> Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
> Link: https://lists.freedesktop.org/archives/dri-devel/2019-May/217014.html
> ---
>  drivers/gpu/drm/panfrost/panfrost_drv.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

Applied.

Rob

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

end of thread, other threads:[~2019-05-13 14:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20190507080405.GA9436@mwanda>
2019-05-09  8:21 ` [PATCH] drm/panfrost: Only put sync_out if non-NULL Tomeu Vizoso
2019-05-09 16:22   ` Steven Price
2019-05-13 14:56   ` Rob Herring

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