diff options
author | Tomeu Vizoso <tomeu.vizoso@collabora.com> | 2019-05-09 10:21:51 +0200 |
---|---|---|
committer | Rob Herring <robh@kernel.org> | 2019-05-13 09:46:53 -0500 |
commit | cc2e787ee7c2c00698bb84a3da4adb3a84187e67 (patch) | |
tree | 7e09f2f74af8e3d6dff855f09e8fd2dd6501c16e /drivers/gpu/drm | |
parent | eb85d03e01c3e9f3b0ba7282b2e3515a635decb2 (diff) | |
download | linux-cc2e787ee7c2c00698bb84a3da4adb3a84187e67.tar.bz2 |
drm/panfrost: Only put sync_out if non-NULL
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>
Signed-off-by: Rob Herring <robh@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20190509082151.8823-1-tomeu.vizoso@collabora.com
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r-- | drivers/gpu/drm/panfrost/panfrost_drv.c | 3 |
1 files changed, 2 insertions, 1 deletions
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; } |