From: Tejun Heo Date: Wed, 1 Jun 2011 06:27:41 +0000 (+0200) Subject: block: blkdev_get() should access ->bd_disk only after success X-Git-Tag: v3.0-rc2~8^2~3 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4c49ff3fe128ca68dabd07537415c419ad7f82f9;p=pandora-kernel.git block: blkdev_get() should access ->bd_disk only after success d4dc210f69 (block: don't block events on excl write for non-optical devices) added dereferencing of bdev->bd_disk to test GENHD_FL_BLOCK_EVENTS_ON_EXCL_WRITE; however, bdev->bd_disk can be %NULL if open failed which can lead to an oops. Test the flag after testing open was successful, not before. Signed-off-by: Tejun Heo Reported-by: David Miller Tested-by: David Miller Cc: stable@kernel.org Signed-off-by: Jens Axboe --- Reading git-diff-tree failed