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 <[email protected]> Reviewed-by: Pranjal Ramajor Asha Kanojiya <[email protected]> Reviewed-by: Jeffrey Hugo <[email protected]> Signed-off-by: Jeffrey Hugo <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent a3efabe commit 3e1b9b2

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

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)