lkml.org 
[lkml]   [2014]   [Jan]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 4/7] ipc: simplify sysvipc_proc_open return
Date
Get rid of silly/useless label jumping.

Signed-off-by: Davidlohr Bueso <davidlohr@hp.com>
---
ipc/util.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/ipc/util.c b/ipc/util.c
index 7afe7de..cecb46e 100644
--- a/ipc/util.c
+++ b/ipc/util.c
@@ -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)
--
1.8.1.4


\
 
 \ /
  Last update: 2014-01-10 20:01    [W:0.139 / U:0.064 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site