From owner-svn-src-head@FreeBSD.ORG Thu May 28 04:03:16 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A1B0E106564A; Thu, 28 May 2009 04:03:16 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8FC998FC13; Thu, 28 May 2009 04:03:16 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4S43G76021913; Thu, 28 May 2009 04:03:16 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4S43GEl021912; Thu, 28 May 2009 04:03:16 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <200905280403.n4S43GEl021912@svn.freebsd.org> From: Adrian Chadd Date: Thu, 28 May 2009 04:03:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r192951 - head/sys/xen/xenbus X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 May 2009 04:03:17 -0000 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); }