summaryrefslogtreecommitdiff
path: root/drivers/block
diff options
context:
space:
mode:
authorRoger Pau Monné <roger.pau@citrix.com>2014-09-15 11:55:27 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-11-14 10:10:25 -0800
commit90e2b7d5186ed1158e5c56cf483754d8edd2e5ee (patch)
tree2630a2febc4b15d3d7dcbd812f49f9f958ffca91 /drivers/block
parentc22f531fe6fca50ca49cd815374db1b0cbe95b16 (diff)
xen-blkback: fix leak on grant map error path
commit 61cecca865280bef4f8a9748d0a9afa5df351ac2 upstream. Fix leaking a page when a grant mapping has failed. Signed-off-by: Roger Pau Monné <roger.pau@citrix.com> Reported-and-Tested-by: Tao Chen <boby.chen@huawei.com> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/block')
-rw-r--r--drivers/block/xen-blkback/blkback.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/block/xen-blkback/blkback.c b/drivers/block/xen-blkback/blkback.c
index 64c60edcdfbc..63fc7f06a014 100644
--- a/drivers/block/xen-blkback/blkback.c
+++ b/drivers/block/xen-blkback/blkback.c
@@ -763,6 +763,7 @@ again:
BUG_ON(new_map_idx >= segs_to_map);
if (unlikely(map[new_map_idx].status != 0)) {
pr_debug(DRV_PFX "invalid buffer -- could not remap it\n");
+ put_free_pages(blkif, &pages[seg_idx]->page, 1);
pages[seg_idx]->handle = BLKBACK_INVALID_HANDLE;
ret |= 1;
goto next;