summaryrefslogtreecommitdiff
path: root/ipc/msg.c
diff options
context:
space:
mode:
authorJens Axboe <axboe@fb.com>2015-10-09 10:08:39 -0600
committerJens Axboe <axboe@fb.com>2015-10-09 10:08:39 -0600
commitfd48ca384960c831d4fae4636282e422e140ca7c (patch)
treecfa3b992c3f589073aed67d46d13404f63a97283 /ipc/msg.c
parent53cbf3b157a0428d40989ab1c7df9228a1976fc2 (diff)
parent049e6dde7e57f0054fdc49102e7ef4830c698b46 (diff)
Merge tag 'v4.3-rc4' into for-4.4/core
Linux 4.3-rc4 Pulling in v4.3-rc4 to avoid conflicts with NVMe fixes that have gone in since for-4.4/core was based.
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)
return retval;
}
- /* ipc_addid() locks msq upon success. */
- id = ipc_addid(&msg_ids(ns), &msq->q_perm, ns->msg_ctlmni);
- if (id < 0) {
- ipc_rcu_putref(msq, msg_rcu_free);
- return id;
- }
-
msq->q_stime = msq->q_rtime = 0;
msq->q_ctime = get_seconds();
msq->q_cbytes = msq->q_qnum = 0;
@@ -153,6 +146,13 @@ static int newque(struct ipc_namespace *ns, struct ipc_params *params)
INIT_LIST_HEAD(&msq->q_receivers);
INIT_LIST_HEAD(&msq->q_senders);
+ /* ipc_addid() locks msq upon success. */
+ id = ipc_addid(&msg_ids(ns), &msq->q_perm, ns->msg_ctlmni);
+ if (id < 0) {
+ ipc_rcu_putref(msq, msg_rcu_free);
+ return id;
+ }
+
ipc_unlock_object(&msq->q_perm);
rcu_read_unlock();