ipc,shm: move BUG_ON check into shm_lock
authorDavidlohr Bueso <[email protected]>
Tue, 30 Jun 2015 21:58:36 +0000 (14:58 -0700)
committerLinus Torvalds <[email protected]>
Wed, 1 Jul 2015 02:44:58 +0000 (19:44 -0700)
commitc5c8975b2eb4eb7604e8ce4f762987f56d2a96a2
tree9f21ef2539c3c0110dde47e1fc6b56c50da8b507
parentc859aa83113dcad165d986e66aa21c5b73745f42
ipc,shm: move BUG_ON check into shm_lock

Upon every shm_lock call, we BUG_ON if an error was returned, indicating
racing either in idr or in shm_destroy.  Move this logic into the locking.

[[email protected]: simplify code]
Signed-off-by: Davidlohr Bueso <[email protected]>
Cc: Manfred Spraul <[email protected]>
Cc: Davidlohr Bueso <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
ipc/shm.c