block: blkdev_get() should access ->bd_disk only after success
d4dc210f (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: NTejun Heo <tj@kernel.org> Reported-by: NDavid Miller <davem@davemloft.net> Tested-by: NDavid Miller <davem@davemloft.net> Cc: stable@kernel.org Signed-off-by: NJens Axboe <jaxboe@fusionio.com>
Showing
想要评论请 注册 或 登录