From: Pavel Emelyanov Date: Thu, 29 Nov 2007 00:21:31 +0000 (-0800) Subject: ipc: lost unlock and fput in mqueue.c on error path X-Git-Tag: v2.6.24-rc4~60 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=fd79b77117f16264206ed2618199d42e93cc8f09;p=linux-2.6-omap-h63xx.git ipc: lost unlock and fput in mqueue.c on error path The error path in sys_mq_getsetattr() after the call to audit_mq_getsetattr() is wrong - the info->lock is not unlocked and the struct file *filp is not put. Fix them both. Signed-off-by: Pavel Emelyanov Cc: Pierre Peiffer Cc: Nadia Derbey Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/ipc/mqueue.c b/ipc/mqueue.c index 1e04cd464af..6ca7b97114f 100644 --- a/ipc/mqueue.c +++ b/ipc/mqueue.c @@ -1138,8 +1138,10 @@ asmlinkage long sys_mq_getsetattr(mqd_t mqdes, omqstat.mq_flags = filp->f_flags & O_NONBLOCK; if (u_mqstat) { ret = audit_mq_getsetattr(mqdes, &mqstat); - if (ret != 0) - goto out; + if (ret != 0) { + spin_unlock(&info->lock); + goto out_fput; + } if (mqstat.mq_flags & O_NONBLOCK) filp->f_flags |= O_NONBLOCK; else