This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
Home Products Support Community News


[Xen-changelog] [xen-unstable] ioemu: error checkin when setting up the

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] ioemu: error checkin when setting up the Cirrus Logic video device.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 07 Sep 2007 09:13:14 -0700
Delivery-date: Fri, 07 Sep 2007 09:20:24 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User kfraser@xxxxxxxxxxxxxxxxxxxxx
# Date 1188313718 -3600
# Node ID 7f53312a32973cdb6664e6f1d55bf3c4f68f5883
# Parent  505021d029eb486449ba5c61403237b49cdfd90a
ioemu: error checkin when setting up the Cirrus Logic video device.

set_mm_mapping() may fail because of xc_domain_populate_physmap().  In
this case, we should not blindly go on; the xc_map_foreign_batch()
that follows will cause a page fault and, at best, get mapped in a
zeroed page from the dom0 (which is not what we want).  While I'm in
here, fix a memory leak on an error path.

Signed-off-by: Chris Lalancette <clalance@xxxxxxxxxx>
 tools/ioemu/hw/cirrus_vga.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletion(-)

diff -r 505021d029eb -r 7f53312a3297 tools/ioemu/hw/cirrus_vga.c
--- a/tools/ioemu/hw/cirrus_vga.c       Tue Aug 28 16:06:32 2007 +0100
+++ b/tools/ioemu/hw/cirrus_vga.c       Tue Aug 28 16:08:38 2007 +0100
@@ -2559,7 +2559,11 @@ static void *set_vram_mapping(unsigned l
     for (i = 0; i < nr_extents; i++)
         extent_start[i] = (begin + i * TARGET_PAGE_SIZE) >> TARGET_PAGE_BITS;
-    set_mm_mapping(xc_handle, domid, nr_extents, 0, extent_start);
+    if (set_mm_mapping(xc_handle, domid, nr_extents, 0, extent_start) < 0) {
+        fprintf(logfile, "Failed set_mm_mapping\n");
+        free(extent_start);
+        return NULL;
+    }
     vram_pointer = xc_map_foreign_batch(xc_handle, domid,
@@ -2567,6 +2571,7 @@ static void *set_vram_mapping(unsigned l
     if (vram_pointer == NULL) {
         fprintf(logfile, "xc_map_foreign_batch vgaram returned error %d\n",
+        free(extent_start);
         return NULL;

Xen-changelog mailing list

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] ioemu: error checkin when setting up the Cirrus Logic video device., Xen patchbot-unstable <=