From owner-svn-src-all@FreeBSD.ORG Thu Feb 19 03:32:49 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 19E95FF1; Thu, 19 Feb 2015 03:32:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DFE10D3; Thu, 19 Feb 2015 03:32:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1J3WmED091458; Thu, 19 Feb 2015 03:32:48 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1J3WmYV091457; Thu, 19 Feb 2015 03:32:48 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201502190332.t1J3WmYV091457@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 19 Feb 2015 03:32:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278984 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 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, 19 Feb 2015 03:32:49 -0000 Author: markj Date: Thu Feb 19 03:32:48 2015 New Revision: 278984 URL: https://svnweb.freebsd.org/changeset/base/278984 Log: Remove unnecessary checks for a return value of NULL from M_WAITOK allocations. MFC after: 3 days Modified: head/sys/kern/kern_ctf.c Modified: head/sys/kern/kern_ctf.c ============================================================================== --- head/sys/kern/kern_ctf.c Thu Feb 19 03:29:46 2015 (r278983) +++ head/sys/kern/kern_ctf.c Thu Feb 19 03:32:48 2015 (r278984) @@ -121,10 +121,7 @@ link_elf_ctf_get(linker_file_t lf, linke NDFREE(&nd, NDF_ONLY_PNBUF); /* Allocate memory for the FLF header. */ - if ((hdr = malloc(sizeof(*hdr), M_LINKER, M_WAITOK)) == NULL) { - error = ENOMEM; - goto out; - } + hdr = malloc(sizeof(*hdr), M_LINKER, M_WAITOK); /* Read the ELF header. */ if ((error = vn_rdwr(UIO_READ, nd.ni_vp, hdr, sizeof(*hdr), @@ -146,10 +143,7 @@ link_elf_ctf_get(linker_file_t lf, linke } /* Allocate memory for all the section headers */ - if ((shdr = malloc(nbytes, M_LINKER, M_WAITOK)) == NULL) { - error = ENOMEM; - goto out; - } + shdr = malloc(nbytes, M_LINKER, M_WAITOK); /* Read all the section headers */ if ((error = vn_rdwr(UIO_READ, nd.ni_vp, (caddr_t)shdr, nbytes, @@ -171,11 +165,7 @@ link_elf_ctf_get(linker_file_t lf, linke } /* Allocate memory to buffer the section header strings. */ - if ((shstrtab = malloc(shdr[hdr->e_shstrndx].sh_size, M_LINKER, - M_WAITOK)) == NULL) { - error = ENOMEM; - goto out; - } + shstrtab = malloc(shdr[hdr->e_shstrndx].sh_size, M_LINKER, M_WAITOK); /* Read the section header strings. */ if ((error = vn_rdwr(UIO_READ, nd.ni_vp, shstrtab, @@ -238,10 +228,7 @@ link_elf_ctf_get(linker_file_t lf, linke * Allocate memory for the compressed CTF data, including * the header (which isn't compressed). */ - if ((raw = malloc(shdr[i].sh_size, M_LINKER, M_WAITOK)) == NULL) { - error = ENOMEM; - goto out; - } + raw = malloc(shdr[i].sh_size, M_LINKER, M_WAITOK); } else { /* * The CTF data is not compressed, so the ELF section @@ -254,10 +241,7 @@ link_elf_ctf_get(linker_file_t lf, linke * Allocate memory to buffer the CTF data in it's decompressed * form. */ - if ((ctftab = malloc(sz, M_LINKER, M_WAITOK)) == NULL) { - error = ENOMEM; - goto out; - } + ctftab = malloc(sz, M_LINKER, M_WAITOK); /* * Read the CTF data into the raw buffer if compressed, or