svn commit: r305667 - head/sys/dev/cxgbe
Navdeep Parhar
np at FreeBSD.org
Fri Sep 9 17:15:17 UTC 2016
Author: np
Date: Fri Sep 9 17:15:16 2016
New Revision: 305667
URL: https://svnweb.freebsd.org/changeset/base/305667
Log:
cxgbe(4): Avoid a NULL dereference in the clearstats ioctl handler.
Port softc's are not initialized when the adapter is in recovery mode.
Modified:
head/sys/dev/cxgbe/t4_main.c
Modified: head/sys/dev/cxgbe/t4_main.c
==============================================================================
--- head/sys/dev/cxgbe/t4_main.c Fri Sep 9 16:18:44 2016 (r305666)
+++ head/sys/dev/cxgbe/t4_main.c Fri Sep 9 17:15:16 2016 (r305667)
@@ -8867,6 +8867,8 @@ t4_ioctl(struct cdev *dev, unsigned long
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);
More information about the svn-src-all
mailing list