diff --git a/sys/i386/conf/XEN b/sys/i386/conf/XEN index 63da8d7..3bfe229 100644 --- a/sys/i386/conf/XEN +++ b/sys/i386/conf/XEN @@ -86,8 +86,8 @@ options CPU_DISABLE_SSE # To make an SMP kernel, the next two lines are needed -options SMP # Symmetric MultiProcessor Kernel -device apic # I/O APIC +#options SMP # Symmetric MultiProcessor Kernel +#device apic # I/O APIC # CPU frequency control #device cpufreq diff --git a/sys/i386/include/xen/xen_clock_util.h b/sys/i386/include/xen/xen_clock_util.h index d28b2dc..ecb8e2c 100644 --- a/sys/i386/include/xen/xen_clock_util.h +++ b/sys/i386/include/xen/xen_clock_util.h @@ -11,8 +11,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES diff --git a/sys/xen/xenbus/xenbus_xs.c b/sys/xen/xenbus/xenbus_xs.c index 4962fec..325f1ce 100644 --- a/sys/xen/xenbus/xenbus_xs.c +++ b/sys/xen/xenbus/xenbus_xs.c @@ -331,8 +331,9 @@ join(const char *dir, const char *name) { char *buffer; - buffer = malloc(strlen(dir) + strlen("/") + strlen(name) + 1, - M_DEVBUF, M_WAITOK); + if ((buffer = malloc(strlen(dir) + strlen("/") + strlen(name) + 1, + M_DEVBUF, M_NOWAIT)) == NULL) + return (NULL); strcpy(buffer, dir); if (strcmp(name, "")) { @@ -378,6 +379,9 @@ xenbus_directory(struct xenbus_transaction t, const char *dir, int error; path = join(dir, node); + if (path == NULL) + return (ENOMEM); + error = xs_single(t, XS_DIRECTORY, path, &len, (void **) &strings); free(path, M_DEVBUF); if (error) @@ -561,8 +565,11 @@ xenbus_printf(struct xenbus_transaction t, #define PRINTF_BUFFER_SIZE 4096 char *printf_buffer; - printf_buffer = malloc(PRINTF_BUFFER_SIZE, M_DEVBUF, M_WAITOK); + printf_buffer = malloc(PRINTF_BUFFER_SIZE, M_DEVBUF, M_NOWAIT); + if (printf_buffer == NULL) + return (ENOMEM); + va_start(ap, fmt); ret = vsnprintf(printf_buffer, PRINTF_BUFFER_SIZE, fmt, ap); va_end(ap); @@ -795,7 +802,9 @@ xs_process_msg(enum xsd_sockmsg_type *type) char *body; int error; - msg = malloc(sizeof(*msg), M_DEVBUF, M_WAITOK); + if ((msg = malloc(sizeof(*msg), M_DEVBUF, M_NOWAIT)) == NULL) + return (ENOMEM); + mtx_lock(&xs_state.reply_lock); error = xb_read(&msg->hdr, sizeof(msg->hdr), &xs_state.reply_lock.lock_object); @@ -805,7 +814,11 @@ xs_process_msg(enum xsd_sockmsg_type *type) return (error); } - body = malloc(msg->hdr.len + 1, M_DEVBUF, M_WAITOK); + if ((body = malloc(msg->hdr.len + 1, M_DEVBUF, M_NOWAIT)) == NULL) { + free(msg, M_DEVBUF); + return (ENOMEM); + } + mtx_lock(&xs_state.reply_lock); error = xb_read(body, msg->hdr.len, &xs_state.reply_lock.lock_object);