]> git.karo-electronics.de Git - karo-tx-linux.git/commit
loopdev: remove an user triggerable oops
authorGuo Chao <yan@linux.vnet.ibm.com>
Thu, 7 Feb 2013 01:26:06 +0000 (12:26 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Mon, 18 Feb 2013 05:46:13 +0000 (16:46 +1100)
commit77da63ea6e0da2b95ce5f62331c51f260e713bbd
tree4917ca6c9a8fafb0b216fd05820841ad84ed377b
parent92361837f9cf0a082833a59f910e9205561316d4
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