Author: emaste
Date: Thu Aug 29 12:05:06 2019
New Revision: 351603
URL: https://svnweb.freebsd.org/changeset/base/351603

Log:
  vnic: avoid NULL deref in error case
  
  Reported by:  Dr Silvio Cesare of InfoSect
  MFC after:    3 days
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/dev/vnic/thunder_bgx.c

Modified: head/sys/dev/vnic/thunder_bgx.c
==============================================================================
--- head/sys/dev/vnic/thunder_bgx.c     Thu Aug 29 09:29:39 2019        
(r351602)
+++ head/sys/dev/vnic/thunder_bgx.c     Thu Aug 29 12:05:06 2019        
(r351603)
@@ -502,9 +502,8 @@ bgx_add_dmac_addr(uint64_t dmac, int node, int bgx_idx
        bgx_idx += node * MAX_BGX_PER_CN88XX;
        bgx = bgx_vnic[bgx_idx];
 
-       if (!bgx) {
-               device_printf(bgx->dev,
-                   "BGX%d not yet initialized, ignoring DMAC addition\n",
+       if (bgx == NULL) {
+               printf("BGX%d not yet initialized, ignoring DMAC addition\n",
                    bgx_idx);
                return;
        }
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to