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:
parent
3662835abf
commit
3aea32935c
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user