svn commit: r351680 - stable/11/sys/dev/vnic

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


Author: emaste
Date: Mon Sep  2 00:39:02 2019
New Revision: 351680
URL: https://svnweb.freebsd.org/changeset/base/351680

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

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

Modified: stable/11/sys/dev/vnic/thunder_bgx.c
==============================================================================
--- stable/11/sys/dev/vnic/thunder_bgx.c	Mon Sep  2 00:37:59 2019	(r351679)
+++ stable/11/sys/dev/vnic/thunder_bgx.c	Mon Sep  2 00:39:02 2019	(r351680)
@@ -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