]> git.baikalelectronics.ru Git - kernel.git/commit
ipc,msg: drop dst nil validation in copy_msg
authorDavidlohr Bueso <dave@stgolabs.net>
Sat, 7 Nov 2015 00:33:04 +0000 (16:33 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 7 Nov 2015 01:50:42 +0000 (17:50 -0800)
commit913428fef64b267b13c836980b8e24df0dcdcc76
tree644e89ea4f70339d6b8f3dddc76132a1f90f8e62
parentb21e971c8c1265b8444bd517e9a2e66e7d2d7a5d
ipc,msg: drop dst nil validation in copy_msg

7fb2b1942c4b ("ipc: convert invalid scenarios to use WARN_ON") relaxed the
nil dst parameter check, originally being a full BUG_ON.  However, this
check seems quite unnecessary when the only purpose is for
ceckpoint/restore (MSG_COPY flag):

o The copy variable is set initially to nil, apparently as a way of
  ensuring that prepare_copy is previously called.  Which is in fact done,
  unconditionally at the beginning of do_msgrcv.

o There is no concurrency with 'copy' (stack allocated in do_msgrcv).

Furthermore, any errors in 'copy' (and thus prepare_copy/copy_msg) should
always handled by IS_ERR() family.  Therefore remove this check altogether
as it can never occur with the current users.

Signed-off-by: Davidlohr Bueso <dbueso@suse.de>
Cc: Stanislav Kinsbursky <skinsbursky@parallels.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
ipc/msgutil.c