aboutsummaryrefslogtreecommitdiffstats
path: root/xen/common/grant_table.c
diff options
context:
space:
mode:
authorHaoyu Zhang <haoyu.zhang@huawei.com>2012-02-06 13:23:41 -0800
committerHaoyu Zhang <haoyu.zhang@huawei.com>2012-02-06 13:23:41 -0800
commit62698cdaf331db0ba7f621040b5c63eaacf6c4a9 (patch)
tree8a8229c1dfff37682f2e896bfa1aa3bba3ab3598 /xen/common/grant_table.c
parentb9110b80ec3e0c87385c5fad9fafa1053ae61bf7 (diff)
downloadxen-62698cdaf331db0ba7f621040b5c63eaacf6c4a9.tar.gz
xen-62698cdaf331db0ba7f621040b5c63eaacf6c4a9.tar.bz2
xen-62698cdaf331db0ba7f621040b5c63eaacf6c4a9.zip
Fix error recovery path in __gnttab_map_grant_ref
In file grant_table.c function __gnttab_map_grant_ref, if __get_paged_frame failed, the effect of _set_status previously called should be rollback, so the flag GTF_reading and _GTF_writing will be recovered. Signed-off-by: Haoyu Zhang <haoyu.zhang@huawei.com> Signed-off-by: Liang Wang <hzwangliang.wang@huawei.com> Acked-by: Andres Lagar-Cavilla <andres@lagarcavilla.org> Committed-by: Keir Fraser <keir@xen.org>
Diffstat (limited to 'xen/common/grant_table.c')
-rw-r--r--xen/common/grant_table.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index 858d991d3d..6bf611f657 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -576,7 +576,7 @@ __gnttab_map_grant_ref(
if ( rc != GNTST_okay )
{
gfn = INVALID_GFN;
- goto unlock_out;
+ goto unlock_out_clear;
}
act->gfn = gfn;
act->domid = ld->domain_id;
@@ -734,7 +734,8 @@ __gnttab_map_grant_ref(
if ( op->flags & GNTMAP_host_map )
act->pin -= (op->flags & GNTMAP_readonly) ?
GNTPIN_hstr_inc : GNTPIN_hstw_inc;
-
+
+ unlock_out_clear:
if ( !(op->flags & GNTMAP_readonly) &&
!(act->pin & (GNTPIN_hstw_mask|GNTPIN_devw_mask)) )
gnttab_clear_flag(_GTF_writing, status);