summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/dev/cxgbe/t4_main.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c
index 67cc887..898a515 100644
--- a/sys/dev/cxgbe/t4_main.c
+++ b/sys/dev/cxgbe/t4_main.c
@@ -8726,6 +8726,8 @@ t4_ioctl(struct cdev *dev, unsigned long cmd, caddr_t data, int fflag,
if (port_id >= sc->params.nports)
return (EINVAL);
pi = sc->port[port_id];
+ if (pi == NULL)
+ return (EIO);
/* MAC stats */
t4_clr_port_stats(sc, pi->tx_chan);
OpenPOWER on IntegriCloud