diff options
author | Dan Carpenter <error27@gmail.com> | 2011-03-19 08:53:31 -0400 |
---|---|---|
committer | Jens Axboe <axboe@carl> | 2011-03-19 08:53:31 -0400 |
commit | 4345caba340f051e10847924fc078ae18ed6695c (patch) | |
tree | aada9145e21b79f31129281bf7d1bb33a1710fbb /fs/block_dev.c | |
parent | 8184f93eced1e304721c2a55c00d87d5a14f8907 (diff) |
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 69e02c59a7d9 "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>
Diffstat (limited to 'fs/block_dev.c')
-rw-r--r-- | fs/block_dev.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/block_dev.c b/fs/block_dev.c index fbe05cbdd692..7d02afb2b7f4 100644 --- a/fs/block_dev.c +++ b/fs/block_dev.c | |||
@@ -1181,9 +1181,9 @@ static int __blkdev_get(struct block_device *bdev, fmode_t mode, int for_part) | |||
1181 | out_unlock_bdev: | 1181 | out_unlock_bdev: |
1182 | mutex_unlock(&bdev->bd_mutex); | 1182 | mutex_unlock(&bdev->bd_mutex); |
1183 | disk_unblock_events(disk); | 1183 | disk_unblock_events(disk); |
1184 | out: | ||
1185 | module_put(disk->fops->owner); | 1184 | module_put(disk->fops->owner); |
1186 | put_disk(disk); | 1185 | put_disk(disk); |
1186 | out: | ||
1187 | bdput(bdev); | 1187 | bdput(bdev); |
1188 | 1188 | ||
1189 | return ret; | 1189 | return ret; |