Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 6 Apr 2017 17:09:00 +0000 (UTC)
From:      Conrad Meyer <cem@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r316582 - head/sys/dev/bwn
Message-ID:  <201704061709.v36H90DI060607@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201704061709.v36H90DI060607>