ipc: simplify sysvipc_proc_open() return
authorDavidlohr Bueso <davidlohr@hp.com>
Tue, 28 Jan 2014 01:07:08 +0000 (17:07 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 28 Jan 2014 05:02:40 +0000 (21:02 -0800)
Get rid of silly/useless label jumping.

Signed-off-by: Davidlohr Bueso <davidlohr@hp.com>
Cc: Aswin Chandramouleeswaran <aswin@hp.com>
Cc: Rik van Riel <riel@redhat.com>
Acked-by: Manfred Spraul <manfred@colorfullife.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
ipc/util.c

index 7afe7def52cfff757989ec6fe8a47fb795d50607..cecb46e89ab04217ac738aa4e00a8bbe3a106548 100644 (file)
@@ -911,8 +911,10 @@ static int sysvipc_proc_open(struct inode *inode, struct file *file)
                goto out;
 
        ret = seq_open(file, &sysvipc_proc_seqops);
-       if (ret)
-               goto out_kfree;
+       if (ret) {
+               kfree(iter);
+               goto out;
+       }
 
        seq = file->private_data;
        seq->private = iter;
@@ -921,9 +923,6 @@ static int sysvipc_proc_open(struct inode *inode, struct file *file)
        iter->ns    = get_ipc_ns(current->nsproxy->ipc_ns);
 out:
        return ret;
-out_kfree:
-       kfree(iter);
-       goto out;
 }
 
 static int sysvipc_proc_release(struct inode *inode, struct file *file)