From owner-svn-src-all@FreeBSD.ORG Thu Dec 2 01:14:46 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3490A106566C; Thu, 2 Dec 2010 01:14:46 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 087DE8FC08; Thu, 2 Dec 2010 01:14:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB21EjGL064274; Thu, 2 Dec 2010 01:14:45 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB21Ejg9064271; Thu, 2 Dec 2010 01:14:45 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201012020114.oB21Ejg9064271@svn.freebsd.org> From: Edward Tomasz Napierala Date: Thu, 2 Dec 2010 01:14:45 +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: r216104 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Dec 2010 01:14:46 -0000 Author: trasz Date: Thu Dec 2 01:14:45 2010 New Revision: 216104 URL: http://svn.freebsd.org/changeset/base/216104 Log: Remove useless NULL checks for M_WAITOK mallocs. Modified: head/sys/kern/sysv_msg.c head/sys/kern/sysv_shm.c Modified: head/sys/kern/sysv_msg.c ============================================================================== --- head/sys/kern/sysv_msg.c Thu Dec 2 01:01:37 2010 (r216103) +++ head/sys/kern/sysv_msg.c Thu Dec 2 01:14:45 2010 (r216104) @@ -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 */ Modified: head/sys/kern/sysv_shm.c ============================================================================== --- head/sys/kern/sysv_shm.c Thu Dec 2 01:01:37 2010 (r216103) +++ head/sys/kern/sysv_shm.c Thu Dec 2 01:14:45 2010 (r216104) @@ -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;