summaryrefslogtreecommitdiff
path: root/ipc
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2013-09-11 14:38:45 +0400
committerTakashi Iwai <tiwai@suse.de>2013-09-11 14:38:45 +0400
commit3d0049e8529adaa36c38a7b400792f6c37b66c92 (patch)
tree7d2e30a5e3f12207305ffc76d80d310c0a95fdcc /ipc
parentbe8cf44526d8972c2dbf6e561162dad924a712a5 (diff)
parent2ae2caff8348378c9e464353e9860ee97583c00b (diff)
downloadlinux-3d0049e8529adaa36c38a7b400792f6c37b66c92.tar.xz
Merge tag 'asoc-v3.12-4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
ASoC: Fixes for v3.12 A few small fixes, nothing with any broad impact but all useful for the affected systems. The Kirkwood compatible string change is fixing up a string just added in the merge window so that we don't get any changes in released kernels.
Diffstat (limited to 'ipc')
-rw-r--r--ipc/msg.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/ipc/msg.c b/ipc/msg.c
index bd60d7e159e8..9f29d9e89bac 100644
--- a/ipc/msg.c
+++ b/ipc/msg.c
@@ -839,7 +839,7 @@ static inline void free_copy(struct msg_msg *copy)
static struct msg_msg *find_msg(struct msg_queue *msq, long *msgtyp, int mode)
{
- struct msg_msg *msg;
+ struct msg_msg *msg, *found = NULL;
long count = 0;
list_for_each_entry(msg, &msq->q_messages, m_list) {
@@ -848,6 +848,7 @@ static struct msg_msg *find_msg(struct msg_queue *msq, long *msgtyp, int mode)
*msgtyp, mode)) {
if (mode == SEARCH_LESSEQUAL && msg->m_type != 1) {
*msgtyp = msg->m_type - 1;
+ found = msg;
} else if (mode == SEARCH_NUMBER) {
if (*msgtyp == count)
return msg;
@@ -857,7 +858,7 @@ static struct msg_msg *find_msg(struct msg_queue *msq, long *msgtyp, int mode)
}
}
- return ERR_PTR(-EAGAIN);
+ return found ?: ERR_PTR(-EAGAIN);
}
long do_msgrcv(int msqid, void __user *buf, size_t bufsz, long msgtyp, int msgflg,