svn commit: r192951 - head/sys/xen/xenbus

Adrian Chadd adrian at FreeBSD.org
Thu May 28 04:03:17 UTC 2009


Author: adrian
Date: Thu May 28 04:03:16 2009
New Revision: 192951
URL: http://svn.freebsd.org/changeset/base/192951

Log:
  Don't call the watch callback if its NULL.
  
  I'm not sure what series of events is leading up to this watch event
  being received with no callback info and it should be investigated.
  I'm triggering it somehow by registering an RTC device (which will
  show up in a subsequent commit.)

Modified:
  head/sys/xen/xenbus/xenbus_xs.c

Modified: head/sys/xen/xenbus/xenbus_xs.c
==============================================================================
--- head/sys/xen/xenbus/xenbus_xs.c	Thu May 28 04:00:03 2009	(r192950)
+++ head/sys/xen/xenbus/xenbus_xs.c	Thu May 28 04:03:16 2009	(r192951)
@@ -769,10 +769,17 @@ xenwatch_thread(void *unused)
 		mtx_unlock(&watch_events_lock);
 
 		if (msg != NULL) {
-			msg->u.watch.handle->callback(
-				msg->u.watch.handle,
-				(const char **)msg->u.watch.vec,
-				msg->u.watch.vec_size);
+			/*
+			 * XXX There are messages coming in with a NULL callback.
+			 * XXX This deserves further investigation; the workaround
+			 * XXX here simply prevents the kernel from panic'ing
+			 * XXX on startup.
+			 */
+			if (msg->u.watch.handle->callback != NULL)
+				msg->u.watch.handle->callback(
+					msg->u.watch.handle,
+					(const char **)msg->u.watch.vec,
+					msg->u.watch.vec_size);
 			free(msg->u.watch.vec, M_DEVBUF);
 			free(msg, M_DEVBUF);
 		}


More information about the svn-src-all mailing list