ia64/xen-unstable
changeset 11096:eb66b68db7b1
[XEN] Add some missing put_page()s to __gnttab_copy.
Signed-off-by: Steven Smith <sos22@cam.ac.uk>
Signed-off-by: Steven Smith <sos22@cam.ac.uk>
author | ssmith@weybridge.uk.xensource.com |
---|---|
date | Mon Aug 14 10:47:59 2006 +0100 (2006-08-14) |
parents | c0a3f670d0d6 |
children | f328519053f5 |
files | xen/common/grant_table.c |
line diff
1.1 --- a/xen/common/grant_table.c Mon Aug 14 10:45:45 2006 +0100 1.2 +++ b/xen/common/grant_table.c Mon Aug 14 10:47:59 2006 +0100 1.3 @@ -821,7 +821,7 @@ static void 1.4 unsigned long s_frame, d_frame; 1.5 char *sp, *dp; 1.6 s16 rc = GNTST_okay; 1.7 - int have_d_grant = 0, have_s_grant = 0; 1.8 + int have_d_grant = 0, have_s_grant = 0, have_s_ref = 0; 1.9 int src_is_gref, dest_is_gref; 1.10 1.11 if ( ((op->source.offset + op->len) > PAGE_SIZE) || 1.12 @@ -872,6 +872,7 @@ static void 1.13 if ( !get_page(mfn_to_page(s_frame), sd) ) 1.14 PIN_FAIL(error_out, GNTST_general_error, 1.15 "could not get source frame %lx.\n", s_frame); 1.16 + have_s_ref = 1; 1.17 1.18 if ( dest_is_gref ) 1.19 { 1.20 @@ -896,7 +897,10 @@ static void 1.21 unmap_domain_page(dp); 1.22 unmap_domain_page(sp); 1.23 1.24 + put_page_and_type(mfn_to_page(d_frame)); 1.25 error_out: 1.26 + if ( have_s_ref ) 1.27 + put_page(mfn_to_page(s_frame)); 1.28 if ( have_s_grant ) 1.29 __release_grant_for_copy(sd, op->source.u.ref, 1); 1.30 if ( have_d_grant )