svn commit: r219299 - head/sys/dev/cxgbe

Navdeep Parhar np at FreeBSD.org
Sat Mar 5 04:19:38 UTC 2011


Author: np
Date: Sat Mar  5 04:19:38 2011
New Revision: 219299
URL: http://svn.freebsd.org/changeset/base/219299

Log:
  Be sure to stay within the bounds of the mod_str array when displaying
  the transceiver type.

Modified:
  head/sys/dev/cxgbe/t4_main.c

Modified: head/sys/dev/cxgbe/t4_main.c
==============================================================================
--- head/sys/dev/cxgbe/t4_main.c	Sat Mar  5 04:18:29 2011	(r219298)
+++ head/sys/dev/cxgbe/t4_main.c	Sat Mar  5 04:19:38 2011	(r219299)
@@ -2720,6 +2720,7 @@ t4_os_pci_restore_state(struct adapter *
 	pci_cfg_restore(dev, dinfo);
 	return (0);
 }
+
 void
 t4_os_portmod_changed(const struct adapter *sc, int idx)
 {
@@ -2730,10 +2731,13 @@ t4_os_portmod_changed(const struct adapt
 
 	if (pi->mod_type == FW_PORT_MOD_TYPE_NONE)
 		if_printf(pi->ifp, "transceiver unplugged.\n");
-	else
+	else if (pi->mod_type > 0 && pi->mod_type < ARRAY_SIZE(mod_str)) {
 		if_printf(pi->ifp, "%s transceiver inserted.\n",
 		    mod_str[pi->mod_type]);
-
+	} else {
+		if_printf(pi->ifp, "transceiver (type %d) inserted.\n",
+		    pi->mod_type);
+	}
 }
 
 void


More information about the svn-src-all mailing list