Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/xen/xen Add more XENPRINTF() to xbdback_connect()
details: https://anonhg.NetBSD.org/src/rev/854ac7757b6e
branches: trunk
changeset: 790757:854ac7757b6e
user: bouyer <bouyer%NetBSD.org@localhost>
date: Sun Oct 20 11:37:11 2013 +0000
description:
Add more XENPRINTF() to xbdback_connect()
in xbdback_backend_changed(), fix memory leak.
Do not free an uninitialized pointer in xbdback_connect(). Should fix
hypervisor or dom0 reboot when using windows PV drivers, as reported
by several users on port-xen.
diffstat:
sys/arch/xen/xen/xbdback_xenbus.c | 15 ++++++++++++---
1 files changed, 12 insertions(+), 3 deletions(-)
diffs (92 lines):
diff -r c349628ebbb7 -r 854ac7757b6e sys/arch/xen/xen/xbdback_xenbus.c
--- a/sys/arch/xen/xen/xbdback_xenbus.c Sun Oct 20 09:30:41 2013 +0000
+++ b/sys/arch/xen/xen/xbdback_xenbus.c Sun Oct 20 11:37:11 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: xbdback_xenbus.c,v 1.57 2012/07/23 01:31:01 jym Exp $ */
+/* $NetBSD: xbdback_xenbus.c,v 1.58 2013/10/20 11:37:11 bouyer Exp $ */
/*
* Copyright (c) 2006 Manuel Bouyer.
@@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xbdback_xenbus.c,v 1.57 2012/07/23 01:31:01 jym Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xbdback_xenbus.c,v 1.58 2013/10/20 11:37:11 bouyer Exp $");
#include <sys/atomic.h>
#include <sys/buf.h>
@@ -530,6 +530,7 @@
const char *proto;
struct xenbus_device *xbusd = xbdi->xbdi_xbusd;
+ XENPRINTF(("xbdback %s: connect\n", xbusd->xbusd_path));
/* read comunication informations */
err = xenbus_read_ul(NULL, xbusd->xbusd_otherend,
"ring-ref", &ring_ref, 10);
@@ -538,6 +539,7 @@
xbusd->xbusd_otherend);
return -1;
}
+ XENPRINTF(("xbdback %s: connect ring-ref %lu\n", xbusd->xbusd_path, ring_ref));
err = xenbus_read_ul(NULL, xbusd->xbusd_otherend,
"event-channel", &revtchn, 10);
if (err) {
@@ -545,12 +547,15 @@
xbusd->xbusd_otherend);
return -1;
}
+ XENPRINTF(("xbdback %s: connect revtchn %lu\n", xbusd->xbusd_path, revtchn));
err = xenbus_read(NULL, xbusd->xbusd_otherend, "protocol",
&len, &xsproto);
if (err) {
xbdi->xbdi_proto = XBDIP_NATIVE;
proto = "unspecified";
+ XENPRINTF(("xbdback %s: connect no xsproto\n", xbusd->xbusd_path));
} else {
+ XENPRINTF(("xbdback %s: connect xsproto %s\n", xbusd->xbusd_path, xsproto));
if (strcmp(xsproto, XEN_IO_PROTO_ABI_NATIVE) == 0) {
xbdi->xbdi_proto = XBDIP_NATIVE;
proto = XEN_IO_PROTO_ABI_NATIVE;
@@ -566,8 +571,8 @@
free(xsproto, M_DEVBUF);
return -1;
}
+ free(xsproto, M_DEVBUF);
}
- free(xsproto, M_DEVBUF);
/* allocate VA space and map rings */
xbdi->xbdi_ring_va = uvm_km_alloc(kernel_map, PAGE_SIZE, 0,
@@ -577,6 +582,7 @@
"can't get VA for ring", xbusd->xbusd_otherend);
return -1;
}
+ XENPRINTF(("xbdback %s: connect va 0x%" PRIxVADDR "\n", xbusd->xbusd_path, xbdi->xbdi_ring_va));
grop.host_addr = xbdi->xbdi_ring_va;
grop.flags = GNTMAP_host_map;
@@ -592,6 +598,7 @@
goto err;
}
xbdi->xbdi_ring_handle = grop.handle;
+ XENPRINTF(("xbdback %s: connect grhandle %d\n", xbusd->xbusd_path, grop.handle));
switch(xbdi->xbdi_proto) {
case XBDIP_NATIVE:
@@ -626,6 +633,7 @@
"can't bind event channel", xbusd->xbusd_otherend);
goto err2;
}
+ XENPRINTF(("xbdback %s: connect evchannel %d\n", xbusd->xbusd_path, xbdi->xbdi_evtchn));
xbdi->xbdi_evtchn = evop.u.bind_interdomain.local_port;
event_set_handler(xbdi->xbdi_evtchn, xbdback_evthandler,
@@ -765,6 +773,7 @@
xbdi->xbdi_ro = false;
else
xbdi->xbdi_ro = true;
+ free(mode, M_DEVBUF);
major = major(xbdi->xbdi_dev);
devname = devsw_blk2name(major);
if (devname == NULL) {
Home |
Main Index |
Thread Index |
Old Index