aboutsummaryrefslogtreecommitdiffstats
path: root/ipc/msg.c
diff options
context:
space:
mode:
Diffstat (limited to 'ipc/msg.c')
-rw-r--r--ipc/msg.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/ipc/msg.c b/ipc/msg.c
index 66c4f567eb73..1471db9a7e61 100644
--- a/ipc/msg.c
+++ b/ipc/msg.c
@@ -137,13 +137,6 @@ static int newque(struct ipc_namespace *ns, struct ipc_params *params)
137 return retval; 137 return retval;
138 } 138 }
139 139
140 /* ipc_addid() locks msq upon success. */
141 id = ipc_addid(&msg_ids(ns), &msq->q_perm, ns->msg_ctlmni);
142 if (id < 0) {
143 ipc_rcu_putref(msq, msg_rcu_free);
144 return id;
145 }
146
147 msq->q_stime = msq->q_rtime = 0; 140 msq->q_stime = msq->q_rtime = 0;
148 msq->q_ctime = get_seconds(); 141 msq->q_ctime = get_seconds();
149 msq->q_cbytes = msq->q_qnum = 0; 142 msq->q_cbytes = msq->q_qnum = 0;
@@ -153,6 +146,13 @@ static int newque(struct ipc_namespace *ns, struct ipc_params *params)
153 INIT_LIST_HEAD(&msq->q_receivers); 146 INIT_LIST_HEAD(&msq->q_receivers);
154 INIT_LIST_HEAD(&msq->q_senders); 147 INIT_LIST_HEAD(&msq->q_senders);
155 148
149 /* ipc_addid() locks msq upon success. */
150 id = ipc_addid(&msg_ids(ns), &msq->q_perm, ns->msg_ctlmni);
151 if (id < 0) {
152 ipc_rcu_putref(msq, msg_rcu_free);
153 return id;
154 }
155
156 ipc_unlock_object(&msq->q_perm); 156 ipc_unlock_object(&msq->q_perm);
157 rcu_read_unlock(); 157 rcu_read_unlock();
158 158