Skip to content

Commit

Permalink
xen/blkfront: don't put bdev right after getting it
Browse files Browse the repository at this point in the history
We should hang onto bdev until we're done with it.

Signed-off-by: Andrew Jones <drjones@redhat.com>
[v1: Fixed up git commit description]
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
  • Loading branch information
Andrew Jones authored and Jens Axboe committed Mar 20, 2012
1 parent 34ae2e4 commit dad5cf6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/block/xen-blkfront.c
Original file line number Diff line number Diff line change
Expand Up @@ -1409,7 +1409,6 @@ static int blkif_release(struct gendisk *disk, fmode_t mode)
mutex_lock(&blkfront_mutex);

bdev = bdget_disk(disk, 0);
bdput(bdev);

if (bdev->bd_openers)
goto out;
Expand Down Expand Up @@ -1440,6 +1439,7 @@ static int blkif_release(struct gendisk *disk, fmode_t mode)
}

out:
bdput(bdev);
mutex_unlock(&blkfront_mutex);
return 0;
}
Expand Down

0 comments on commit dad5cf6

Please sign in to comment.