Skip to contentSkip to conversation

qemu and qemu-xen: fix segfault on con_disconnect

PATCH Applied Stefano Stabellini 1 participant 1 message Jan 19, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 2/5 qemu and qemu-xen: fix segfault on con_disconnect

The test on xendev->gnttabdev in con_disconnect is wrong: what differentiates the consoles is the dev number.

hw/xen_console.c +1 -1
index d7099c4..0a2374c 100644
@@ -258,7 +258,7 @@ static void con_disconnect(struct XenDevice *xendev)
     xen_be_unbind_evtchn(&con->xendev);
 
     if (con->sring) {
-        if (!xendev->gnttabdev)
+        if (!xendev->dev)
 	    munmap(con->sring, XC_PAGE_SIZE);
         else
             xc_gnttab_munmap(xendev->gnttabdev, con->sring, 1);