]> git.baikalelectronics.ru Git - kernel.git/commit
ipc: set msg back to -EAGAIN if copy wasn't performed
authorStanislav Kinsbursky <skinsbursky@parallels.com>
Mon, 1 Apr 2013 07:40:51 +0000 (11:40 +0400)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 2 Apr 2013 17:09:01 +0000 (10:09 -0700)
commitf88a75c12870dd22b6c45a168fe720b565fc7ac0
treec260602e6d7233a0e05f252c0dfcb4dae587b9d2
parentb5aab1dfb7b5bc9a65319f9f78d76092577cd264
ipc: set msg back to -EAGAIN if copy wasn't performed

Make sure that msg pointer is set back to error value in case of
MSG_COPY flag is set and desired message to copy wasn't found.  This
garantees that msg is either a error pointer or a copy address.

Otherwise the last message in queue will be freed without unlinking from
the queue (which leads to memory corruption) and the dummy allocated
copy won't be released.

Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
ipc/msg.c