From owner-svn-src-all@freebsd.org Sat Feb 2 17:56:06 2019 Return-Path: Delivered-To: svn-src-all@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 7186F14C5FF9; Sat, 2 Feb 2019 17:56:06 +0000 (UTC) (envelope-from andriyvos@gmail.com) Received: from mail-lf1-f54.google.com (mail-lf1-f54.google.com [209.85.167.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0037A91BFA; Sat, 2 Feb 2019 17:56:05 +0000 (UTC) (envelope-from andriyvos@gmail.com) Received: by mail-lf1-f54.google.com with SMTP id p6so7442419lfc.1; Sat, 02 Feb 2019 09:56:05 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:cc:subject:references:date:mime-version :content-transfer-encoding:from:message-id:in-reply-to:user-agent; bh=ilk79F/N7koU9N6mi6CTWPZsK21E7IeX3Kk5O+Ksjj0=; b=ZvthyiWd66l/UCbZZ2qtFaQ+WWUqAh6RLYewo57f4PpI5MC18utMLswejXmCnohDbD jWoP/v/8ByqbtDQdgt79KFeSLaGzpjw5eReBPypzm54mWPNsK1Z1sLPPHJbz4j+PlOy5 umdGv8F+ZoyUgzZSJI0Y61KgHIi7QhnvordxMRyP2wFd/gYTbvvkB5XxrKdnmJbgcMMq LKlpeI54A6kjNmVPdlnQ9mqUXzhMSbd8qayMqk5dcWGJlC4UjpvbXaU7xZLsSLiWESP7 JT1vINsDvK4jkPONVTxVI5RORAlZd4s20/SHnT1QY2vNhBfQWHvJL0eb3ZyqfPRkpE1f aAvw== X-Gm-Message-State: AHQUAuZ4m9QGpZTdMy5TYt3H2qXRipXsb5PCagZEURUsGpX8DdZVtFAT /14s+4XaQ9wpOkeFbPkB7ww= X-Google-Smtp-Source: AHgI3IbQ/6ik/NjGE2jF8kiSjkG2X+eyLtoZrJjLlH1Y0Stc4EVA+42WA+Mjefva+4Yn4PndKxBheg== X-Received: by 2002:ac2:550e:: with SMTP id j14mr7738278lfk.110.1549129694796; Sat, 02 Feb 2019 09:48:14 -0800 (PST) Received: from localhost ([37.73.131.213]) by smtp.gmail.com with ESMTPSA id m12sm2028946lfc.30.2019.02.02.09.48.13 (version=TLS1 cipher=AES128-SHA bits=128/128); Sat, 02 Feb 2019 09:48:14 -0800 (PST) Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: "Rodney W. Grimes" , rgrimes@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r343682 - head/sys/dev/wtap References: <201902021730.x12HUrcO028481@pdx.rh.CN85.dnsmgr.net> Date: Sat, 02 Feb 2019 19:47:33 +0200 MIME-Version: 1.0 Content-Transfer-Encoding: Quoted-Printable From: "Andriy Voskoboinyk" Message-ID: In-Reply-To: <201902021730.x12HUrcO028481@pdx.rh.CN85.dnsmgr.net> User-Agent: Opera Mail/12.15 (FreeBSD) X-Rspamd-Queue-Id: 0037A91BFA X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.958,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 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: Sat, 02 Feb 2019 17:56:06 -0000 Sat, 02 Feb 2019 19:30:53 +0200 =D0=B1=D1=83=D0=BB=D0=BE =D0=BD=D0=B0=D0= =BF=D0=B8=D1=81=D0=B0=D0=BD=D0=BE Rodney W. Grimes = : > [ 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 >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D >> --- 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 =3D malloc(sizeof(struct ieee80211_node), M_80211_NODE, >> M_NOWAIT|M_ZERO); >> + if (ni =3D=3D NULL) >> + return (NULL); >> >> ni->ni_txrate =3D 130; >> return ni; > > Um, this simplifies to and preserves single return: > > if (ni !=3D NULL) > ni->ni_txrate =3D 130; > return ni; Yes, but code style for this function is just the same across all wireless drivers and ieee80211_node(4) man page; also, it clearly shows the main code path.