From 03dd3ecc10632a788c21cf7faa14aedf2ea44dcd Mon Sep 17 00:00:00 2001 From: Mikko Perttunen Date: Wed, 4 Dec 2024 02:45:32 +0000 Subject: [PATCH] gpu: host1x-fence: Fix fence leak in fence_extract The fence_extract IOCTL handler was only putting the fence object on the error path. Add a put to the success path as well. Bug 4799184 Change-Id: Ib9fa3280320f16e1cf5588bd7b58900644601649 Signed-off-by: Mikko Perttunen Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3261313 GVS: buildbot_gerritrpt Reviewed-by: svcacv Reviewed-by: Santosh BS --- drivers/gpu/host1x-fence/dev.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/host1x-fence/dev.c b/drivers/gpu/host1x-fence/dev.c index fa95e28e..2229978a 100644 --- a/drivers/gpu/host1x-fence/dev.c +++ b/drivers/gpu/host1x-fence/dev.c @@ -172,6 +172,8 @@ static int dev_file_ioctl_fence_extract(struct host1x *host1x, void __user *data goto put_fence; } + dma_fence_put(fence); + return 0; put_fence: