xen/gntalloc: release grant references on page free
authorDaniel De Graaf <dgdegra@tycho.nsa.gov>
Mon, 28 Nov 2011 16:49:10 +0000 (11:49 -0500)
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Fri, 16 Dec 2011 16:26:02 +0000 (11:26 -0500)
gnttab_end_foreign_access_ref does not return the grant reference it is
passed to the free list; gnttab_free_grant_reference needs to be
explicitly called. While gnttab_end_foreign_access provides a wrapper
for this, it is unsuitable because it does not return errors.

Reported-by: Anil Madhavapeddy <anil@recoil.org>
Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
drivers/xen/gntalloc.c

index c95181f43a6a05c2cbc71bc608854bb69ab711b0..f330a4b8b685234021c1795e34cfad08d91a2e27 100644 (file)
@@ -191,6 +191,8 @@ static void __del_gref(struct gntalloc_gref *gref)
 
                if (!gnttab_end_foreign_access_ref(gref->gref_id, 0))
                        return;
+
+               gnttab_free_grant_reference(gref->gref_id);
        }
 
        gref_size--;