summaryrefslogtreecommitdiff
path: root/ipc/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'ipc/util.c')
-rw-r--r--ipc/util.c26
1 files changed, 7 insertions, 19 deletions
diff --git a/ipc/util.c b/ipc/util.c
index 27d74e69fd57..88adc329888c 100644
--- a/ipc/util.c
+++ b/ipc/util.c
@@ -309,7 +309,7 @@ int ipc_addid(struct ipc_ids *ids, struct kern_ipc_perm *new, int size)
/**
* ipcget_new - create a new ipc object
* @ns: ipc namespace
- * @ids: ipc identifer set
+ * @ids: ipc identifier set
* @ops: the actual creation routine to call
* @params: its parameters
*
@@ -363,7 +363,7 @@ static int ipc_check_perms(struct ipc_namespace *ns,
/**
* ipcget_public - get an ipc object or create a new one
* @ns: ipc namespace
- * @ids: ipc identifer set
+ * @ids: ipc identifier set
* @ops: the actual creation routine to call
* @params: its parameters
*
@@ -669,7 +669,7 @@ out:
/**
* ipcget - Common sys_*get() code
- * @ns: namsepace
+ * @ns: namespace
* @ids: ipc identifier set
* @ops: operations to be called on ipc object creation, permission checks
* and further checks
@@ -892,28 +892,16 @@ static const struct seq_operations sysvipc_proc_seqops = {
static int sysvipc_proc_open(struct inode *inode, struct file *file)
{
- int ret;
- struct seq_file *seq;
struct ipc_proc_iter *iter;
- ret = -ENOMEM;
- iter = kmalloc(sizeof(*iter), GFP_KERNEL);
+ iter = __seq_open_private(file, &sysvipc_proc_seqops, sizeof(*iter));
if (!iter)
- goto out;
-
- ret = seq_open(file, &sysvipc_proc_seqops);
- if (ret) {
- kfree(iter);
- goto out;
- }
-
- seq = file->private_data;
- seq->private = iter;
+ return -ENOMEM;
iter->iface = PDE_DATA(inode);
iter->ns = get_ipc_ns(current->nsproxy->ipc_ns);
-out:
- return ret;
+
+ return 0;
}
static int sysvipc_proc_release(struct inode *inode, struct file *file)