summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoger Pau Monné <roger.pau@citrix.com>2014-09-15 11:55:27 +0200
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>2014-10-01 22:32:31 +0200
commit61cecca865280bef4f8a9748d0a9afa5df351ac2 (patch)
treeeb30df0f55ab4d62026151bb068c596262094d33
parentxen/blkback: unmap all persistent grants when frontend gets disconnected (diff)
downloadlinux-61cecca865280bef4f8a9748d0a9afa5df351ac2.tar.xz
linux-61cecca865280bef4f8a9748d0a9afa5df351ac2.zip
xen-blkback: fix leak on grant map error path
Fix leaking a page when a grant mapping has failed. CC: stable@vger.kernel.org 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>
-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;