]> git.karo-electronics.de Git - karo-tx-linux.git/commit
loopdev: remove an user triggerable oops
authorGuo Chao <yan@linux.vnet.ibm.com>
Wed, 20 Feb 2013 02:13:54 +0000 (13:13 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 20 Feb 2013 05:52:17 +0000 (16:52 +1100)
commitef5b0e6b169ba37988c6daa6388b8cc41a21a329
tree9961d6558ced654087f2da501519148c81c5035c
parent50bff3dc269dead2a773de85a6eb27e12f72c19e
loopdev: remove an user triggerable oops

When loopdev is built as module and we pass an invalid parameter,
loop_init() will return directly without deregister misc device, which
will cause an oops when insert loop module next time because we left some
garbage in the misc device list.

Test case:
sudo modprobe loop max_part=1024
(failed due to invalid parameter)
sudo modprobe loop
(oops)

Clean up nicely to avoid such oops.

Signed-off-by: Guo Chao <yan@linux.vnet.ibm.com>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Guo Chao <yan@linux.vnet.ibm.com>
Cc: M. Hindess <hindessm@uk.ibm.com>
Cc: Nikanth Karthikesan <knikanth@suse.de>
Cc: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
drivers/block/loop.c