From: Satyam Sharma Date: Mon, 16 Jul 2007 06:40:07 +0000 (-0700) Subject: rocket.c: fix unchecked mutex_lock_interruptible() X-Git-Tag: MMI-PSA29.97-13-9~42114 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=1e3e8d91fee56e1ab598b265466dc38033f1b915;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git 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 Cc: Jiri Slaby Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- 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);