Skip to content

Commit

Permalink
block: NULL dereference on error path in __blkdev_get()
Browse files Browse the repository at this point in the history
"disk" is always NULL when we goto out.  There was a check for this
before, but it was removed in 69e02c5 "block: Don't check events
while open is in progress".

Signed-off-by: Dan Carpenter <error27@gmail.com>
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Jens Axboe <axboe@carl>
  • Loading branch information
Dan Carpenter authored and Jens Axboe committed Mar 19, 2011
1 parent 8184f93 commit 4345cab
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/block_dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 4345cab

Please sign in to comment.