diff options
author | Andrew Jones <drjones@redhat.com> | 2012-02-16 07:16:25 -0500 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2012-03-20 07:52:41 -0400 |
commit | dad5cf659b202b5070c8616b5c515f6ca4db0c42 (patch) | |
tree | 0ca624ebdcf62e2ddc7a25b749ba8f3c3c953bde /drivers/block/xen-blkfront.c | |
parent | 34ae2e47d97216d8c66a1c5dff5b530c29b746b8 (diff) |
xen/blkfront: don't put bdev right after getting it
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>
Diffstat (limited to 'drivers/block/xen-blkfront.c')
-rw-r--r-- | drivers/block/xen-blkfront.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c index 619868d91ca8..537cb722a211 100644 --- a/drivers/block/xen-blkfront.c +++ b/drivers/block/xen-blkfront.c | |||
@@ -1409,7 +1409,6 @@ static int blkif_release(struct gendisk *disk, fmode_t mode) | |||
1409 | mutex_lock(&blkfront_mutex); | 1409 | mutex_lock(&blkfront_mutex); |
1410 | 1410 | ||
1411 | bdev = bdget_disk(disk, 0); | 1411 | bdev = bdget_disk(disk, 0); |
1412 | bdput(bdev); | ||
1413 | 1412 | ||
1414 | if (bdev->bd_openers) | 1413 | if (bdev->bd_openers) |
1415 | goto out; | 1414 | goto out; |
@@ -1440,6 +1439,7 @@ static int blkif_release(struct gendisk *disk, fmode_t mode) | |||
1440 | } | 1439 | } |
1441 | 1440 | ||
1442 | out: | 1441 | out: |
1442 | bdput(bdev); | ||
1443 | mutex_unlock(&blkfront_mutex); | 1443 | mutex_unlock(&blkfront_mutex); |
1444 | return 0; | 1444 | return 0; |
1445 | } | 1445 | } |