diff --git a/src/freedreno/drm/freedreno_pipe.c b/src/freedreno/drm/freedreno_pipe.c index 8552c15d220..cc51a55d4df 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 = dev; + pipe->dev = fd_device_ref(dev); pipe->id = id; p_atomic_set(&pipe->refcnt, 1); @@ -114,6 +114,7 @@ fd_pipe_del_locked(struct fd_pipe *pipe) if (!p_atomic_dec_zero(&pipe->refcnt)) return; fd_bo_del_locked(pipe->control_mem); + fd_device_del_locked(pipe->dev); pipe->funcs->destroy(pipe); }