From owner-svn-src-head@freebsd.org Sat Feb 2 17:30:57 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4690114C491C; Sat, 2 Feb 2019 17:30:57 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BDD558FFE7; Sat, 2 Feb 2019 17:30:56 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x12HUrCZ028482; Sat, 2 Feb 2019 09:30:53 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id x12HUrcO028481; Sat, 2 Feb 2019 09:30:53 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201902021730.x12HUrcO028481@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r343682 - head/sys/dev/wtap In-Reply-To: <201902021615.x12GFkmQ000435@repo.freebsd.org> To: Andriy Voskoboinyk Date: Sat, 2 Feb 2019 09:30:53 -0800 (PST) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: BDD558FFE7 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.94 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.94)[-0.936,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Feb 2019 17:30:57 -0000 [ Charset UTF-8 unsupported, converting... ] > Author: avos > Date: Sat Feb 2 16:15:46 2019 > New Revision: 343682 > URL: https://svnweb.freebsd.org/changeset/base/343682 > > Log: > sys/dev/wtap: Check return value from malloc(..., M_NOWAIT) and > drop unneeded cast. > > MFC after: 3 days > > Modified: > head/sys/dev/wtap/if_wtap.c > > Modified: head/sys/dev/wtap/if_wtap.c > ============================================================================== > --- head/sys/dev/wtap/if_wtap.c Sat Feb 2 16:07:56 2019 (r343681) > +++ head/sys/dev/wtap/if_wtap.c Sat Feb 2 16:15:46 2019 (r343682) > @@ -373,7 +373,7 @@ wtap_vap_delete(struct ieee80211vap *vap) > destroy_dev(avp->av_dev); > callout_stop(&avp->av_swba); > ieee80211_vap_detach(vap); > - free((struct wtap_vap*) vap, M_80211_VAP); > + free(avp, M_80211_VAP); > } > > static void > @@ -602,6 +602,8 @@ wtap_node_alloc(struct ieee80211vap *vap, const uint8_ > > ni = malloc(sizeof(struct ieee80211_node), M_80211_NODE, > M_NOWAIT|M_ZERO); > + if (ni == NULL) > + return (NULL); > > ni->ni_txrate = 130; > return ni; Um, this simplifies to and preserves single return: if (ni != NULL) ni->ni_txrate = 130; return ni; -- Rod Grimes rgrimes@freebsd.org