linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] block: NULL dereference on error path in __blkdev_get()
@ 2011-03-13 20:59 Dan Carpenter
  2011-03-14  8:58 ` Tejun Heo
  0 siblings, 1 reply; 3+ messages in thread
From: Dan Carpenter @ 2011-03-13 20:59 UTC (permalink / raw)
  To: Alexander Viro, tj; +Cc: linux-fsdevel, kernel-janitors

"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>

diff --git a/fs/block_dev.c b/fs/block_dev.c
index fbe05cb..7d02afb 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)
  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;

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-03-18  8:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-13 20:59 [patch] block: NULL dereference on error path in __blkdev_get() Dan Carpenter
2011-03-14  8:58 ` Tejun Heo
2011-03-18  8:32   ` Tejun Heo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).