From owner-svn-src-all@freebsd.org Thu Mar 31 13:20:04 2016 Return-Path: Delivered-To: svn-src-all@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 08388AE4274; Thu, 31 Mar 2016 13:20:04 +0000 (UTC) (envelope-from trasz@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 CA3BC1103; Thu, 31 Mar 2016 13:20:03 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2VDK3PF092296; Thu, 31 Mar 2016 13:20:03 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2VDK27X092294; Thu, 31 Mar 2016 13:20:02 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201603311320.u2VDK27X092294@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 31 Mar 2016 13:20:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297452 - head/sys/dev/sfxge 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.21 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, 31 Mar 2016 13:20:04 -0000 Author: trasz Date: Thu Mar 31 13:20:02 2016 New Revision: 297452 URL: https://svnweb.freebsd.org/changeset/base/297452 Log: Remove NULL checks after M_WAITOK allocations, which - by definition - can never return NULL. Reviewed by: arybchik@ MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D5773 Modified: head/sys/dev/sfxge/sfxge_mcdi.c head/sys/dev/sfxge/sfxge_nvram.c Modified: head/sys/dev/sfxge/sfxge_mcdi.c ============================================================================== --- head/sys/dev/sfxge/sfxge_mcdi.c Thu Mar 31 13:13:38 2016 (r297451) +++ head/sys/dev/sfxge/sfxge_mcdi.c Thu Mar 31 13:20:02 2016 (r297452) @@ -250,10 +250,6 @@ sfxge_mcdi_ioctl(struct sfxge_softc *sc, } mcdibuf = malloc(SFXGE_MCDI_MAX_PAYLOAD, M_TEMP, M_WAITOK | M_ZERO); - if (mcdibuf == NULL) { - rc = ENOMEM; - goto fail4; - } if ((rc = copyin(ip->u.mcdi.payload, mcdibuf, ip->u.mcdi.len)) != 0) { goto fail5; } @@ -292,7 +288,6 @@ sfxge_mcdi_ioctl(struct sfxge_softc *sc, fail6: fail5: free(mcdibuf, M_TEMP); -fail4: fail3: fail2: fail1: Modified: head/sys/dev/sfxge/sfxge_nvram.c ============================================================================== --- head/sys/dev/sfxge/sfxge_nvram.c Thu Mar 31 13:13:38 2016 (r297451) +++ head/sys/dev/sfxge/sfxge_nvram.c Thu Mar 31 13:20:02 2016 (r297452) @@ -75,10 +75,6 @@ sfxge_nvram_rw(struct sfxge_softc *sc, s goto fail1; buf = malloc(chunk_size, M_TEMP, M_WAITOK); - if (buf == NULL) { - rc = ENOMEM; - goto fail2; - } off = 0; while (total_size) { @@ -108,7 +104,6 @@ sfxge_nvram_rw(struct sfxge_softc *sc, s fail3: free(buf, M_TEMP); -fail2: efx_nvram_rw_finish(enp, type); fail1: return (rc);