[PATCH] scsi: st: Fix lock leak in st_ioctl()
From: Hongling Zeng
Date: Wed May 20 2026 - 03:40:48 EST
The default case in the switch statement returns directly from
st_common_ioctl() without releasing &STp->lock, causing a lock
imbalance. Fix by jumping to the out label to properly release
the lock.
Fixes: b37d70c0df85 ("scsi: st: Separate st-unique ioctl handling from SCSI common ioctl handling")
Signed-off-by: Hongling Zeng <zenghongling@xxxxxxxxxx>
---
drivers/scsi/st.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/scsi/st.c b/drivers/scsi/st.c
index f1c3c4946637..3b08992e1b10 100644
--- a/drivers/scsi/st.c
+++ b/drivers/scsi/st.c
@@ -3628,7 +3628,8 @@ static long st_ioctl(struct file *file, unsigned int cmd_in, unsigned long arg)
case MTIOCTOP:
break;
default:
- return st_common_ioctl(STp, STm, file, cmd_in, arg);
+ retval = st_common_ioctl(STp, STm, file, cmd_in, arg);
+ goto out;
}
cmd_type = _IOC_TYPE(cmd_in);
--
2.25.1