Re: [PATCH] block: blkdev_get() should acess ->bd_disk only aftersuccess
From: Jens Axboe
Date: Wed Jun 01 2011 - 02:29:19 EST
On 2011-06-01 01:56, Tejun Heo wrote:
> 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.
Thanks, applied.
--
Jens Axboe
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/