Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 30 Apr 2019 21:27:33 +0000 (UTC)
From:      Navdeep Parhar <np@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r346975 - stable/12/sys/dev/cxgbe
Message-ID:  <201904302127.x3ULRXUd006551@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: np
Date: Tue Apr 30 21:27:32 2019
New Revision: 346975
URL: https://svnweb.freebsd.org/changeset/base/346975

Log:
  MFC r346567:
  
  cxgbe(4): Make sure bundled_fw is always initialized before use.
  
  This fixes a bug that prevented the driver from auto-flashing the
  firmware when it didn't see one on the card.  This feature was
  introduced in r321390 and this bug was introduced in r343269.
  
  Reported by:	gallatin@
  Sponsored by:	Chelsio Communications

Modified:
  stable/12/sys/dev/cxgbe/t4_main.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/cxgbe/t4_main.c
==============================================================================
--- stable/12/sys/dev/cxgbe/t4_main.c	Tue Apr 30 21:24:44 2019	(r346974)
+++ stable/12/sys/dev/cxgbe/t4_main.c	Tue Apr 30 21:27:32 2019	(r346975)
@@ -3529,19 +3529,6 @@ install_kld_firmware(struct adapter *sc, struct fw_h *
 	load_attempted = false;
 	fw_install = t4_fw_install < 0 ? -t4_fw_install : t4_fw_install;
 
-	if (reason != NULL)
-		goto install;
-
-	if ((sc->flags & FW_OK) == 0) {
-
-		if (c == 0xffffffff) {
-			reason = "missing";
-			goto install;
-		}
-
-		return (0);
-	}
-
 	memcpy(&bundled_fw, drv_fw, sizeof(bundled_fw));
 	if (t4_fw_install < 0) {
 		rc = load_fw_module(sc, &cfg, &fw);
@@ -3557,6 +3544,20 @@ install_kld_firmware(struct adapter *sc, struct fw_h *
 		load_attempted = true;
 	}
 	d = be32toh(bundled_fw.fw_ver);
+
+	if (reason != NULL)
+		goto install;
+
+	if ((sc->flags & FW_OK) == 0) {
+
+		if (c == 0xffffffff) {
+			reason = "missing";
+			goto install;
+		}
+
+		rc = 0;
+		goto done;
+	}
 
 	if (!fw_compatible(card_fw, &bundled_fw)) {
 		reason = "incompatible or unusable";



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