diff options
author | np <np@FreeBSD.org> | 2011-03-05 04:19:38 +0000 |
---|---|---|
committer | np <np@FreeBSD.org> | 2011-03-05 04:19:38 +0000 |
commit | 154e7a9e1b3b5b34692d8c1e59704d1567bbc073 (patch) | |
tree | 0469788c970910e3f1ec0bf96397fd370f196a0b /sys/dev/cxgbe/t4_main.c | |
parent | cb91098a1a8e4d8e0959341257caf60791d8a2ce (diff) | |
download | FreeBSD-src-154e7a9e1b3b5b34692d8c1e59704d1567bbc073.zip FreeBSD-src-154e7a9e1b3b5b34692d8c1e59704d1567bbc073.tar.gz |
Be sure to stay within the bounds of the mod_str array when displaying
the transceiver type.
Diffstat (limited to 'sys/dev/cxgbe/t4_main.c')
-rw-r--r-- | sys/dev/cxgbe/t4_main.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index 430ce08..1c38faf 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -2720,6 +2720,7 @@ t4_os_pci_restore_state(struct adapter *sc) 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 adapter *sc, int idx) 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 |