summaryrefslogtreecommitdiff
path: root/drivers/char/rocket.c
diff options
context:
space:
mode:
authorSatyam Sharma <satyam.sharma@gmail.com>2007-07-15 23:40:07 -0700
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-16 09:05:43 -0700
commit1e3e8d91fee56e1ab598b265466dc38033f1b915 (patch)
treeb6115a2aa12c650ad8c43b315df9558b3c4ca81b /drivers/char/rocket.c
parent60bfba7e85f88fe834e623ead799cf580de20971 (diff)
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 <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>
Diffstat (limited to 'drivers/char/rocket.c')
-rw-r--r--drivers/char/rocket.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/char/rocket.c b/drivers/char/rocket.c
index a3fd7e7ba5a9..0270080ff0c0 100644
--- a/drivers/char/rocket.c
+++ b/drivers/char/rocket.c
@@ -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);