mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
Remove useless NULL checks for M_WAITOK mallocs.
This commit is contained in:
parent
6157935fa5
commit
26778a6c82
2 changed files with 0 additions and 19 deletions
|
|
@ -200,18 +200,10 @@ msginit()
|
|||
TUNABLE_INT_FETCH("kern.ipc.msgtql", &msginfo.msgtql);
|
||||
|
||||
msgpool = malloc(msginfo.msgmax, M_MSG, M_WAITOK);
|
||||
if (msgpool == NULL)
|
||||
panic("msgpool is NULL");
|
||||
msgmaps = malloc(sizeof(struct msgmap) * msginfo.msgseg, M_MSG, M_WAITOK);
|
||||
if (msgmaps == NULL)
|
||||
panic("msgmaps is NULL");
|
||||
msghdrs = malloc(sizeof(struct msg) * msginfo.msgtql, M_MSG, M_WAITOK);
|
||||
if (msghdrs == NULL)
|
||||
panic("msghdrs is NULL");
|
||||
msqids = malloc(sizeof(struct msqid_kernel) * msginfo.msgmni, M_MSG,
|
||||
M_WAITOK);
|
||||
if (msqids == NULL)
|
||||
panic("msqids is NULL");
|
||||
|
||||
/*
|
||||
* msginfo.msgssz should be a power of two for efficiency reasons.
|
||||
|
|
@ -233,9 +225,6 @@ msginit()
|
|||
panic("msginfo.msgseg > 32767");
|
||||
}
|
||||
|
||||
if (msgmaps == NULL)
|
||||
panic("msgmaps is NULL");
|
||||
|
||||
for (i = 0; i < msginfo.msgseg; i++) {
|
||||
if (i > 0)
|
||||
msgmaps[i-1].next = i;
|
||||
|
|
@ -244,9 +233,6 @@ msginit()
|
|||
free_msgmaps = 0;
|
||||
nfree_msgmaps = msginfo.msgseg;
|
||||
|
||||
if (msghdrs == NULL)
|
||||
panic("msghdrs is NULL");
|
||||
|
||||
for (i = 0; i < msginfo.msgtql; i++) {
|
||||
msghdrs[i].msg_type = 0;
|
||||
if (i > 0)
|
||||
|
|
@ -258,9 +244,6 @@ msginit()
|
|||
}
|
||||
free_msghdrs = &msghdrs[0];
|
||||
|
||||
if (msqids == NULL)
|
||||
panic("msqids is NULL");
|
||||
|
||||
for (i = 0; i < msginfo.msgmni; i++) {
|
||||
msqids[i].u.msg_qbytes = 0; /* implies entry is available */
|
||||
msqids[i].u.msg_perm.seq = 0; /* reset to a known value */
|
||||
|
|
|
|||
|
|
@ -878,8 +878,6 @@ shminit()
|
|||
|
||||
shmalloced = shminfo.shmmni;
|
||||
shmsegs = malloc(shmalloced * sizeof(shmsegs[0]), M_SHM, M_WAITOK);
|
||||
if (shmsegs == NULL)
|
||||
panic("cannot allocate initial memory for sysvshm");
|
||||
for (i = 0; i < shmalloced; i++) {
|
||||
shmsegs[i].u.shm_perm.mode = SHMSEG_FREE;
|
||||
shmsegs[i].u.shm_perm.seq = 0;
|
||||
|
|
|
|||
Loading…
Reference in a new issue