Skip to content

Commit

Permalink
ipc: simplify sysvipc_proc_open() return
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Davidlohr Bueso authored and torvalds committed Jan 28, 2014
1 parent 95d4eb2 commit 8dc5cd0
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions ipc/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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)
Expand Down

0 comments on commit 8dc5cd0

Please sign in to comment.