提交 4345caba 编写于 作者: D Dan Carpenter 提交者: 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: NDan Carpenter <error27@gmail.com>
Acked-by: NTejun Heo <tj@kernel.org>
Signed-off-by: NJens Axboe <axboe@carl>
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册