Commit 4345caba authored by Dan Carpenter's avatar Dan Carpenter Committed by Jens Axboe

block: NULL dereference on error path in __blkdev_get()

"disk" is always NULL when we goto out.  There was a check for this
before, but it was removed in 69e02c59 "block: Don't check events
while open is in progress".
Signed-off-by: default avatarDan Carpenter <error27@gmail.com>
Acked-by: default avatarTejun Heo <tj@kernel.org>
Signed-off-by: default avatarJens Axboe <axboe@carl>
parent 8184f93e
......@@ -1181,9 +1181,9 @@ static int __blkdev_get(struct block_device *bdev, fmode_t mode, int for_part)
out_unlock_bdev:
mutex_unlock(&bdev->bd_mutex);
disk_unblock_events(disk);
out:
module_put(disk->fops->owner);
put_disk(disk);
out:
bdput(bdev);
return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment