From db0f273cfb48d1229e2ca16dac661b484b486264 Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Sat, 10 Dec 2022 12:39:40 -0800 Subject: [PATCH] freedreno/drm: Drop pipe ref to device The context and screen already holds refs to the device. But since fd_bo_fence holds a ref to the pipe, anyone anywhere leaking a single bo with unwaited fences could cause the device to leak indirectly. Signed-off-by: Rob Clark Part-of: --- src/freedreno/drm/freedreno_pipe.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/freedreno/drm/freedreno_pipe.c b/src/freedreno/drm/freedreno_pipe.c index 1f5aa3ba8c9..9b6cbf59b9d 100644 --- a/src/freedreno/drm/freedreno_pipe.c +++ b/src/freedreno/drm/freedreno_pipe.c @@ -53,7 +53,7 @@ fd_pipe_new2(struct fd_device *dev, enum fd_pipe_id id, uint32_t prio) return NULL; } - pipe->dev = fd_device_ref(dev); + pipe->dev = dev; pipe->id = id; p_atomic_set(&pipe->refcnt, 1); @@ -124,7 +124,6 @@ fd_pipe_del_locked(struct fd_pipe *pipe) return; fd_bo_del(pipe->control_mem); - fd_device_del(pipe->dev); pipe->funcs->destroy(pipe); }