mqueue: fix kernel BUG caused by double free() on mq_open()
authorAndré Goddard Rosa <[email protected]>
Tue, 11 May 2010 21:07:03 +0000 (14:07 -0700)
committerLinus Torvalds <[email protected]>
Wed, 12 May 2010 00:33:42 +0000 (17:33 -0700)
commita3ed2a15719219769bb095b28009c1d654a419e8
tree22039574b16ad79f9eba06317e8f1ad7cd9d53c3
parentde145b44b95b9d3212a82d1c0f29b09778ef33c5
mqueue: fix kernel BUG caused by double free() on mq_open()

In case of aborting because we reach the maximum amount of memory which
can be allocated to message queues per user (RLIMIT_MSGQUEUE), we would
try to free the message area twice when bailing out: first by the error
handling code itself, and then later when cleaning up the inode through
delete_inode().

Signed-off-by: André Goddard Rosa <[email protected]>
Cc: Alexey Dobriyan <[email protected]>
Cc: Al Viro <[email protected]>
Cc: <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
ipc/mqueue.c