svn commit: r351679 - stable/12/sys/dev/vnic

Ed Maste emaste at FreeBSD.org
Mon Sep 2 00:38:00 UTC 2019


Author: emaste
Date: Mon Sep  2 00:37:59 2019
New Revision: 351679
URL: https://svnweb.freebsd.org/changeset/base/351679

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

Modified:
  stable/12/sys/dev/vnic/thunder_bgx.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/vnic/thunder_bgx.c
==============================================================================
--- stable/12/sys/dev/vnic/thunder_bgx.c	Mon Sep  2 00:36:26 2019	(r351678)
+++ stable/12/sys/dev/vnic/thunder_bgx.c	Mon Sep  2 00:37:59 2019	(r351679)
@@ -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;
 	}


More information about the svn-src-all mailing list