From: Linus Torvalds Date: Sat, 6 Nov 2010 00:45:59 +0000 (-0700) Subject: floppy: fix use-after-free in module load failure path X-Git-Tag: v2.6.37-rc2~83 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c093ee4f07f46d3a835841cafa07514fa94878d2;p=pandora-kernel.git floppy: fix use-after-free in module load failure path Commit 488211844e0c ("floppy: switch to one queue per drive instead of sharing a queue") introduced a use-after-free. We do "put_disk()" on the disk device _before_ we then clean up the queue associated with that disk. Move the put_disk() down to avoid dereferencing a free'd data structure. Cc: Jens Axboe Cc: Vivek Goyal Reported-and-tested-by: Randy Dunlap Signed-off-by: Linus Torvalds --- Reading git-diff-tree failed