Skip to content

Commit

Permalink
xen/gntalloc: release grant references on page free
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Daniel De Graaf <[email protected]>
Signed-off-by: Konrad Rzeszutek Wilk <[email protected]>
  • Loading branch information
dgdegraaf authored and konradwilk committed Dec 16, 2011
1 parent c3b3f16 commit 0105d2b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/xen/gntalloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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--;
Expand Down

0 comments on commit 0105d2b

Please sign in to comment.