Skip to content

Commit 1e3e8d9

Browse files
Satyam SharmaLinus Torvalds
authored andcommitted
rocket.c: fix unchecked mutex_lock_interruptible()
Check the return of mutex_lock_interruptible() in drivers/char/rocket.c and return ERESTARTSYS if we were interrupted. Signed-off-by: Satyam Sharma <[email protected]> Cc: Jiri Slaby <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 60bfba7 commit 1e3e8d9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/char/rocket.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1702,7 +1702,8 @@ static int rp_write(struct tty_struct *tty,
17021702
if (count <= 0 || rocket_paranoia_check(info, "rp_write"))
17031703
return 0;
17041704

1705-
mutex_lock_interruptible(&info->write_mtx);
1705+
if (mutex_lock_interruptible(&info->write_mtx))
1706+
return -ERESTARTSYS;
17061707

17071708
#ifdef ROCKET_DEBUG_WRITE
17081709
printk(KERN_INFO "rp_write %d chars...", count);

0 commit comments

Comments
 (0)