diff options
author | adrian <adrian@FreeBSD.org> | 2009-05-28 04:03:16 +0000 |
---|---|---|
committer | adrian <adrian@FreeBSD.org> | 2009-05-28 04:03:16 +0000 |
commit | 1a7a5c4571399083173a0fd134f527491429f069 (patch) | |
tree | 2c057a76d5a5f0158ed5317eda4617337295a328 /sys/xen | |
parent | 687197c4392406297303bb3f4db96aaedfa60bf9 (diff) | |
download | FreeBSD-src-1a7a5c4571399083173a0fd134f527491429f069.zip FreeBSD-src-1a7a5c4571399083173a0fd134f527491429f069.tar.gz |
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.)
Diffstat (limited to 'sys/xen')
-rw-r--r-- | sys/xen/xenbus/xenbus_xs.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/sys/xen/xenbus/xenbus_xs.c b/sys/xen/xenbus/xenbus_xs.c index 8069556..9312255 100644 --- a/sys/xen/xenbus/xenbus_xs.c +++ b/sys/xen/xenbus/xenbus_xs.c @@ -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); } |