Commit cc2e787e authored by Tomeu Vizoso's avatar Tomeu Vizoso Committed by Rob Herring

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: default avatarTomeu Vizoso <tomeu.vizoso@collabora.com>
Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Link: https://lists.freedesktop.org/archives/dri-devel/2019-May/217014.htmlReviewed-by: default avatarSteven Price <steven.price@arm.com>
Signed-off-by: default avatarRob Herring <robh@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20190509082151.8823-1-tomeu.vizoso@collabora.com
parent eb85d03e
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment