cxgbe(4): Avoid a NULL dereference in the clearstats ioctl handler.

Port softc's are not initialized when the adapter is in recovery mode.
This commit is contained in:
Navdeep Parhar 2016-09-09 17:15:16 +00:00
parent 3662835abf
commit 3aea32935c

View File

@ -8867,6 +8867,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);