aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ipc/msg.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/ipc/msg.c b/ipc/msg.c
index fede1d06ef30..b46473074662 100644
--- a/ipc/msg.c
+++ b/ipc/msg.c
@@ -862,16 +862,8 @@ long do_msgrcv(int msqid, void __user *buf, size_t bufsz, long msgtyp,
862 walk_msg->m_type != 1) { 862 walk_msg->m_type != 1) {
863 msgtyp = walk_msg->m_type - 1; 863 msgtyp = walk_msg->m_type - 1;
864 } else if (msgflg & MSG_COPY) { 864 } else if (msgflg & MSG_COPY) {
865 if (copy_number == msg_counter) { 865 if (copy_number == msg_counter)
866 /*
867 * Found requested message.
868 * Copy it.
869 */
870 msg = copy_msg(msg, copy);
871 if (IS_ERR(msg))
872 goto out_unlock;
873 break; 866 break;
874 }
875 msg = ERR_PTR(-EAGAIN); 867 msg = ERR_PTR(-EAGAIN);
876 } else 868 } else
877 break; 869 break;
@@ -892,8 +884,10 @@ long do_msgrcv(int msqid, void __user *buf, size_t bufsz, long msgtyp,
892 * If we are copying, then do not unlink message and do 884 * If we are copying, then do not unlink message and do
893 * not update queue parameters. 885 * not update queue parameters.
894 */ 886 */
895 if (msgflg & MSG_COPY) 887 if (msgflg & MSG_COPY) {
888 msg = copy_msg(msg, copy);
896 goto out_unlock; 889 goto out_unlock;
890 }
897 list_del(&msg->m_list); 891 list_del(&msg->m_list);
898 msq->q_qnum--; 892 msq->q_qnum--;
899 msq->q_rtime = get_seconds(); 893 msq->q_rtime = get_seconds();