Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 5 Mar 2011 04:19:38 +0000 (UTC)
From:      Navdeep Parhar <np@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r219299 - head/sys/dev/cxgbe
Message-ID:  <201103050419.p254JcpR005519@svn.freebsd.org>

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



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