Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 29 Aug 2019 12:05:06 +0000 (UTC)
From:      Ed Maste <emaste@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r351603 - head/sys/dev/vnic
Message-ID:  <201908291205.x7TC56qJ028329@repo.freebsd.org>

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



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