rocket.c: fix unchecked mutex_lock_interruptible()
authorSatyam Sharma <satyam.sharma@gmail.com>
Mon, 16 Jul 2007 06:40:07 +0000 (23:40 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Mon, 16 Jul 2007 16:05:43 +0000 (09:05 -0700)
Check the return of mutex_lock_interruptible() in drivers/char/rocket.c and
return ERESTARTSYS if we were interrupted.

Signed-off-by: Satyam Sharma <satyam.sharma@gmail.com>
Cc: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/char/rocket.c

index a3fd7e7ba5a977556ccae27fcb4ca2bffa0c4eee..0270080ff0c01bedf874624febcc3a245a995d02 100644 (file)
@@ -1702,7 +1702,8 @@ static int rp_write(struct tty_struct *tty,
        if (count <= 0 || rocket_paranoia_check(info, "rp_write"))
                return 0;
 
-       mutex_lock_interruptible(&info->write_mtx);
+       if (mutex_lock_interruptible(&info->write_mtx))
+               return -ERESTARTSYS;
 
 #ifdef ROCKET_DEBUG_WRITE
        printk(KERN_INFO "rp_write %d chars...", count);