svn commit: r346975 - stable/12/sys/dev/cxgbe

Navdeep Parhar np at FreeBSD.org
Tue Apr 30 21:27:34 UTC 2019


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";


More information about the svn-src-all mailing list