diff options
author | Kevin Hilman <khilman@linaro.org> | 2015-10-20 11:26:33 -0700 |
---|---|---|
committer | Kevin Hilman <khilman@linaro.org> | 2015-10-20 11:26:33 -0700 |
commit | 09147a74376428080eddfed0cbce2cab205c2508 (patch) | |
tree | 7c903b82831eb03498dfc89c615e2acd5e1d9d6f /ipc/msg.c | |
parent | e4bec9707eb7446e0cd1961f91e6948819327933 (diff) | |
parent | c2fab09b2ec32f252029757ba3353ea3d308c811 (diff) |
Merge branch 'test/linux-linaro-lsk-v3.18-android' of git://android.git.linaro.org/kernel/linaro-android into linux-linaro-lsk-v3.18-androidlsk-v3.18-15.10-android
Diffstat (limited to 'ipc/msg.c')
-rw-r--r-- | ipc/msg.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/ipc/msg.c b/ipc/msg.c index c5d8e3749985..cfc8b388332d 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(); |