]> xenbits.xensource.com Git - xen.git/commitdiff
hvm_set_ioreq_page() releases wrong page in error path
authorPaul Durrant <paul.durrant@citrix.com>
Mon, 12 May 2014 15:42:33 +0000 (17:42 +0200)
committerJan Beulich <jbeulich@suse.com>
Mon, 12 May 2014 15:42:33 +0000 (17:42 +0200)
The function calls prepare_ring_for_helper() to acquire a mapping for the
given gmfn, then checks (under lock) to see if the ioreq page is already
set up but, if it is, the function then releases the in-use ioreq page
mapping on the error path rather than the one it just acquired. This patch
fixes this bug.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
master commit: 16e2a7596e9fc86881c73cef57602b2c88155528
master date: 2014-05-02 11:46:32 +0200

xen/arch/x86/hvm/hvm.c

index a0e7d79b6e5a00439e57a33f545948c411ea576f..68531abdc0c85851a36523078060a302d802cc40 100644 (file)
@@ -446,7 +446,7 @@ static int hvm_set_ioreq_page(
 
     if ( (iorp->va != NULL) || d->is_dying )
     {
-        destroy_ring_for_helper(&iorp->va, iorp->page);
+        destroy_ring_for_helper(&va, page);
         spin_unlock(&iorp->lock);
         return -EINVAL;
     }