From owner-svn-src-head@freebsd.org Thu Apr 6 17:09:01 2017 Return-Path: Delivered-To: svn-src-head@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 193CDD30E20; Thu, 6 Apr 2017 17:09:01 +0000 (UTC) (envelope-from cem@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 DDE60A25; Thu, 6 Apr 2017 17:09:00 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v36H906L060612; Thu, 6 Apr 2017 17:09:00 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v36H90DI060607; Thu, 6 Apr 2017 17:09:00 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201704061709.v36H90DI060607@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Thu, 6 Apr 2017 17:09:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316582 - head/sys/dev/bwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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: Thu, 06 Apr 2017 17:09:01 -0000 Author: cem Date: Thu Apr 6 17:08:59 2017 New Revision: 316582 URL: https://svnweb.freebsd.org/changeset/base/316582 Log: bwn(4): Fix trivial null dereference Reported by: PVS-Studio Sponsored by: Dell EMC Isilon Modified: head/sys/dev/bwn/if_bwn.c Modified: head/sys/dev/bwn/if_bwn.c ============================================================================== --- head/sys/dev/bwn/if_bwn.c Thu Apr 6 16:22:54 2017 (r316581) +++ head/sys/dev/bwn/if_bwn.c Thu Apr 6 17:08:59 2017 (r316582) @@ -6754,10 +6754,15 @@ static void bwn_txpwr(void *arg, int npending) { struct bwn_mac *mac = arg; - struct bwn_softc *sc = mac->mac_sc; + struct bwn_softc *sc; + + if (mac == NULL) + return; + + sc = mac->mac_sc; BWN_LOCK(sc); - if (mac && mac->mac_status >= BWN_MAC_STATUS_STARTED && + if (mac->mac_status >= BWN_MAC_STATUS_STARTED && mac->mac_phy.set_txpwr != NULL) mac->mac_phy.set_txpwr(mac); BWN_UNLOCK(sc);