]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/panfrost: Fix wait_bo ioctl leaking positive return from dma_resv_wait_timeout()
authorGyeyoung Baek <gye976@gmail.com>
Sun, 19 Apr 2026 07:17:16 +0000 (16:17 +0900)
committerSteven Price <steven.price@arm.com>
Thu, 7 May 2026 13:52:55 +0000 (14:52 +0100)
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: f3ba91228e8e ("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>
drivers/gpu/drm/panfrost/panfrost_drv.c

index 711f5101aa04ce98240289bbaabfb59c8dd0b030..074c0995ddc26cb4f8ad914b5ef293fd1cc61688 100644 (file)
@@ -390,6 +390,8 @@ panfrost_ioctl_wait_bo(struct drm_device *dev, void *data,
                                    true, timeout);
        if (!ret)
                ret = timeout ? -ETIMEDOUT : -EBUSY;
+       else if (ret > 0)
+               ret = 0;
 
        drm_gem_object_put(gem_obj);