From owner-svn-src-stable@freebsd.org Mon Jun 27 21:44:29 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E149EB84915; Mon, 27 Jun 2016 21:44:29 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 A241D27DC; Mon, 27 Jun 2016 21:44:29 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5RLiSKw027800; Mon, 27 Jun 2016 21:44:28 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5RLiSuk027793; Mon, 27 Jun 2016 21:44:28 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201606272144.u5RLiSuk027793@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 27 Jun 2016 21:44:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r302233 - in stable/10/sys: kern net netinet rpc ufs/ufs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jun 2016 21:44:30 -0000 Author: bdrewery Date: Mon Jun 27 21:44:27 2016 New Revision: 302233 URL: https://svnweb.freebsd.org/changeset/base/302233 Log: MFC r297391: Remove some NULL checks for M_WAITOK allocations. Modified: stable/10/sys/kern/imgact_elf.c stable/10/sys/kern/kern_exec.c stable/10/sys/kern/kern_linker.c stable/10/sys/net/rtsock.c stable/10/sys/netinet/tcp_subr.c stable/10/sys/rpc/rpc_generic.c stable/10/sys/ufs/ufs/ufs_extattr.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/imgact_elf.c ============================================================================== --- stable/10/sys/kern/imgact_elf.c Mon Jun 27 21:37:30 2016 (r302232) +++ stable/10/sys/kern/imgact_elf.c Mon Jun 27 21:44:27 2016 (r302233) @@ -1325,10 +1325,6 @@ __elfN(coredump)(struct thread *td, stru * and write it out following the notes. */ hdr = malloc(hdrsize, M_TEMP, M_WAITOK); - if (hdr == NULL) { - error = EINVAL; - goto done; - } error = __elfN(corehdr)(td, vp, cred, seginfo.count, hdr, hdrsize, ¬elst, notesz, gzfile); Modified: stable/10/sys/kern/kern_exec.c ============================================================================== --- stable/10/sys/kern/kern_exec.c Mon Jun 27 21:37:30 2016 (r302232) +++ stable/10/sys/kern/kern_exec.c Mon Jun 27 21:44:27 2016 (r302233) @@ -1498,8 +1498,6 @@ exec_register(execsw_arg) for (es = execsw; *es; es++) count++; newexecsw = malloc(count * sizeof(*es), M_TEMP, M_WAITOK); - if (newexecsw == NULL) - return (ENOMEM); xs = newexecsw; if (execsw) for (es = execsw; *es; es++) @@ -1532,8 +1530,6 @@ exec_unregister(execsw_arg) if (*es != execsw_arg) count++; newexecsw = malloc(count * sizeof(*es), M_TEMP, M_WAITOK); - if (newexecsw == NULL) - return (ENOMEM); xs = newexecsw; for (es = execsw; *es; es++) if (*es != execsw_arg) Modified: stable/10/sys/kern/kern_linker.c ============================================================================== --- stable/10/sys/kern/kern_linker.c Mon Jun 27 21:37:30 2016 (r302232) +++ stable/10/sys/kern/kern_linker.c Mon Jun 27 21:44:27 2016 (r302233) @@ -1762,8 +1762,6 @@ linker_hints_lookup(const char *path, in goto bad; } hints = malloc(vattr.va_size, M_TEMP, M_WAITOK); - if (hints == NULL) - goto bad; error = vn_rdwr(UIO_READ, nd.ni_vp, (caddr_t)hints, vattr.va_size, 0, UIO_SYSSPACE, IO_NODELOCKED, cred, NOCRED, &reclen, td); if (error) Modified: stable/10/sys/net/rtsock.c ============================================================================== --- stable/10/sys/net/rtsock.c Mon Jun 27 21:37:30 2016 (r302232) +++ stable/10/sys/net/rtsock.c Mon Jun 27 21:44:27 2016 (r302233) @@ -301,8 +301,6 @@ rts_attach(struct socket *so, int proto, /* XXX */ rp = malloc(sizeof *rp, M_PCB, M_WAITOK | M_ZERO); - if (rp == NULL) - return ENOBUFS; so->so_pcb = (caddr_t)rp; so->so_fibnum = td->td_proc->p_fibnum; Modified: stable/10/sys/netinet/tcp_subr.c ============================================================================== --- stable/10/sys/netinet/tcp_subr.c Mon Jun 27 21:37:30 2016 (r302232) +++ stable/10/sys/netinet/tcp_subr.c Mon Jun 27 21:44:27 2016 (r302233) @@ -1285,8 +1285,6 @@ tcp_pcblist(SYSCTL_HANDLER_ARGS) return (error); inp_list = malloc(n * sizeof *inp_list, M_TEMP, M_WAITOK); - if (inp_list == NULL) - return (ENOMEM); INP_INFO_RLOCK(&V_tcbinfo); for (inp = LIST_FIRST(V_tcbinfo.ipi_listhead), i = 0; Modified: stable/10/sys/rpc/rpc_generic.c ============================================================================== --- stable/10/sys/rpc/rpc_generic.c Mon Jun 27 21:37:30 2016 (r302232) +++ stable/10/sys/rpc/rpc_generic.c Mon Jun 27 21:44:27 2016 (r302233) @@ -390,15 +390,11 @@ __rpc_uaddr2taddr_af(int af, const char } ret = (struct netbuf *)malloc(sizeof *ret, M_RPC, M_WAITOK); - if (ret == NULL) - goto out; switch (af) { case AF_INET: sin = (struct sockaddr_in *)malloc(sizeof *sin, M_RPC, M_WAITOK); - if (sin == NULL) - goto out; memset(sin, 0, sizeof *sin); sin->sin_family = AF_INET; sin->sin_port = htons(port); @@ -415,8 +411,6 @@ __rpc_uaddr2taddr_af(int af, const char case AF_INET6: sin6 = (struct sockaddr_in6 *)malloc(sizeof *sin6, M_RPC, M_WAITOK); - if (sin6 == NULL) - goto out; memset(sin6, 0, sizeof *sin6); sin6->sin6_family = AF_INET6; sin6->sin6_port = htons(port); @@ -433,8 +427,6 @@ __rpc_uaddr2taddr_af(int af, const char case AF_LOCAL: sun = (struct sockaddr_un *)malloc(sizeof *sun, M_RPC, M_WAITOK); - if (sun == NULL) - goto out; memset(sun, 0, sizeof *sun); sun->sun_family = AF_LOCAL; strncpy(sun->sun_path, addrstr, sizeof(sun->sun_path) - 1); Modified: stable/10/sys/ufs/ufs/ufs_extattr.c ============================================================================== --- stable/10/sys/ufs/ufs/ufs_extattr.c Mon Jun 27 21:37:30 2016 (r302232) +++ stable/10/sys/ufs/ufs/ufs_extattr.c Mon Jun 27 21:44:27 2016 (r302233) @@ -599,8 +599,6 @@ ufs_extattr_enable(struct ufsmount *ump, attribute = malloc(sizeof(struct ufs_extattr_list_entry), M_UFS_EXTATTR, M_WAITOK); - if (attribute == NULL) - return (ENOMEM); if (!(ump->um_extattr.uepm_flags & UFS_EXTATTR_UEPM_STARTED)) { error = EOPNOTSUPP;