Skip to content

Commit c76273c

Browse files
gye976gregkh
authored andcommitted
drm/panfrost: Fix wait_bo ioctl leaking positive return from dma_resv_wait_timeout()
commit 459d75523b71c0ec254d153d8850d0b7008af396 upstream. dma_resv_wait_timeout() returns a positive 'remaining jiffies' value on success, 0 on timeout, and -errno on failure. panfrost_ioctl_wait_bo() returns this 'long' result from an int-typed ioctl handler, so positive values reach userspace as bogus errors. Explicitly set ret to 0 on the success path. Fixes: f3ba912 ("drm/panfrost: Add initial panfrost driver") Cc: stable@vger.kernel.org Signed-off-by: Gyeyoung Baek <gye976@gmail.com> Reviewed-by: Adrián Larumbe <adrian.larumbe@collabora.com> Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> Reviewed-by: Steven Price <steven.price@arm.com> Link: https://patch.msgid.link/fe33f82fded7be1c18e2e0eb2db451d5a738cf39.1776581974.git.gye976@gmail.com Signed-off-by: Steven Price <steven.price@arm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 65a3a1c commit c76273c

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

drivers/gpu/drm/panfrost/panfrost_drv.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,8 @@ panfrost_ioctl_wait_bo(struct drm_device *dev, void *data,
365365
true, timeout);
366366
if (!ret)
367367
ret = timeout ? -ETIMEDOUT : -EBUSY;
368+
else if (ret > 0)
369+
ret = 0;
368370

369371
drm_gem_object_put(gem_obj);
370372

0 commit comments

Comments
 (0)