Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=fd79b77117f16264206ed2618199d42e93cc8f09
Commit:     fd79b77117f16264206ed2618199d42e93cc8f09
Parent:     75d427982fef672b3608ae809b8819ec6358edfe
Author:     Pavel Emelyanov <[EMAIL PROTECTED]>
AuthorDate: Wed Nov 28 16:21:31 2007 -0800
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Thu Nov 29 09:24:52 2007 -0800

    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 <[EMAIL PROTECTED]>
    Cc: Pierre Peiffer <[EMAIL PROTECTED]>
    Cc: Nadia Derbey <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 ipc/mqueue.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/ipc/mqueue.c b/ipc/mqueue.c
index 1e04cd4..6ca7b97 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
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to