summaryrefslogtreecommitdiffstats
path: root/drivers/accel/qaic
diff options
context:
space:
mode:
authorCarl Vanderlip <quic_carlv@quicinc.com>2023-06-02 15:04:39 -0600
committerJeffrey Hugo <quic_jhugo@quicinc.com>2023-06-09 11:06:33 -0600
commit3e1b9b2d81901b3ceeb5ec1f1b4c41cd1cff53ba (patch)
tree12d36c1ba3562dff881c2f9ec609528720aa4ad3 /drivers/accel/qaic
parenta3efabee5878b8d7b1863debb78cb7129d07a346 (diff)
downloadlinux-3e1b9b2d81901b3ceeb5ec1f1b4c41cd1cff53ba.tar.gz
linux-3e1b9b2d81901b3ceeb5ec1f1b4c41cd1cff53ba.tar.bz2
linux-3e1b9b2d81901b3ceeb5ec1f1b4c41cd1cff53ba.zip
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: c501ca23a6a3 ("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
Diffstat (limited to 'drivers/accel/qaic')
-rw-r--r--drivers/accel/qaic/qaic_drv.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/accel/qaic/qaic_drv.c b/drivers/accel/qaic/qaic_drv.c
index 2d0828db28d8..961cd341b414 100644
--- a/drivers/accel/qaic/qaic_drv.c
+++ b/drivers/accel/qaic/qaic_drv.c
@@ -97,6 +97,7 @@ static int qaic_open(struct drm_device *dev, struct drm_file *file)
cleanup_usr:
cleanup_srcu_struct(&usr->qddev_lock);
+ ida_free(&qaic_usrs, usr->handle);
free_usr:
kfree(usr);
dev_unlock: