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 69e02c59a7 "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>
	
	
This commit is contained in:
		
					parent
					
						
							
								8184f93ece
							
						
					
				
			
			
				commit
				
					
						4345caba34
					
				
			
		
					 1 changed files with 1 additions and 1 deletions
				
			
		| 
						 | 
					@ -1181,9 +1181,9 @@ static int __blkdev_get(struct block_device *bdev, fmode_t mode, int for_part)
 | 
				
			||||||
 out_unlock_bdev:
 | 
					 out_unlock_bdev:
 | 
				
			||||||
	mutex_unlock(&bdev->bd_mutex);
 | 
						mutex_unlock(&bdev->bd_mutex);
 | 
				
			||||||
	disk_unblock_events(disk);
 | 
						disk_unblock_events(disk);
 | 
				
			||||||
 out:
 | 
					 | 
				
			||||||
	module_put(disk->fops->owner);
 | 
						module_put(disk->fops->owner);
 | 
				
			||||||
	put_disk(disk);
 | 
						put_disk(disk);
 | 
				
			||||||
 | 
					 out:
 | 
				
			||||||
	bdput(bdev);
 | 
						bdput(bdev);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return ret;
 | 
						return ret;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue