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);
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to