Skip to content

Commit 3e1b9b2

Browse files
Carl Vanderlipquic-jhugo
authored andcommitted
accel/qaic: Free user handle on interrupted mutex
After user handle is allocated, if mutex is interrupted, we do not free the user handle and return an error. Kref had been initialized, but not added to users list, so device teardown would also not call free_usr. Fixes: c501ca2 ("accel/qaic: Add uapi and core driver file") Signed-off-by: Carl Vanderlip <quic_carlv@quicinc.com> Reviewed-by: Pranjal Ramajor Asha Kanojiya <quic_pkanojiy@quicinc.com> Reviewed-by: Jeffrey Hugo <quic_jhugo@quicinc.com> Signed-off-by: Jeffrey Hugo <quic_jhugo@quicinc.com> Link: https://patchwork.freedesktop.org/patch/msgid/20230602210440.8411-2-quic_jhugo@quicinc.com
1 parent a3efabe commit 3e1b9b2

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

drivers/accel/qaic/qaic_drv.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ static int qaic_open(struct drm_device *dev, struct drm_file *file)
9797

9898
cleanup_usr:
9999
cleanup_srcu_struct(&usr->qddev_lock);
100+
ida_free(&qaic_usrs, usr->handle);
100101
free_usr:
101102
kfree(usr);
102103
dev_unlock:

0 commit comments

Comments
 (0)