kern_module.c (108905) | kern_module.c (109623) |
---|---|
1/*- 2 * Copyright (c) 1997 Doug Rabson 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * | 1/*- 2 * Copyright (c) 1997 Doug Rabson 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * |
26 * $FreeBSD: head/sys/kern/kern_module.c 108905 2003-01-07 22:24:13Z peter $ | 26 * $FreeBSD: head/sys/kern/kern_module.c 109623 2003-01-21 08:56:16Z alfred $ |
27 */ 28 29#include <sys/param.h> 30#include <sys/kernel.h> 31#include <sys/systm.h> 32#include <sys/eventhandler.h> 33#include <sys/malloc.h> 34#include <sys/sysproto.h> --- 92 unchanged lines hidden (view full) --- 127 if (newmod != NULL) { 128 MOD_SUNLOCK; 129 printf("module_register: module %s already exists!\n", 130 data->name); 131 return (EEXIST); 132 } 133 MOD_SUNLOCK; 134 namelen = strlen(data->name) + 1; | 27 */ 28 29#include <sys/param.h> 30#include <sys/kernel.h> 31#include <sys/systm.h> 32#include <sys/eventhandler.h> 33#include <sys/malloc.h> 34#include <sys/sysproto.h> --- 92 unchanged lines hidden (view full) --- 127 if (newmod != NULL) { 128 MOD_SUNLOCK; 129 printf("module_register: module %s already exists!\n", 130 data->name); 131 return (EEXIST); 132 } 133 MOD_SUNLOCK; 134 namelen = strlen(data->name) + 1; |
135 newmod = malloc(sizeof(struct module) + namelen, M_MODULE, M_WAITOK); | 135 newmod = malloc(sizeof(struct module) + namelen, M_MODULE, 0); |
136 if (newmod == NULL) 137 return (ENOMEM); 138 MOD_XLOCK; 139 newmod->refs = 1; 140 newmod->id = nextid++; 141 newmod->name = (char *)(newmod + 1); 142 strcpy(newmod->name, data->name); 143 newmod->handler = data->evhand ? data->evhand : modevent_nop; --- 251 unchanged lines hidden --- | 136 if (newmod == NULL) 137 return (ENOMEM); 138 MOD_XLOCK; 139 newmod->refs = 1; 140 newmod->id = nextid++; 141 newmod->name = (char *)(newmod + 1); 142 strcpy(newmod->name, data->name); 143 newmod->handler = data->evhand ? data->evhand : modevent_nop; --- 251 unchanged lines hidden --- |