Date: Fri, 9 Sep 2016 17:15:16 +0000 (UTC) From: Navdeep Parhar <np@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305667 - head/sys/dev/cxgbe Message-ID: <201609091715.u89HFGVY081529@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201609091715.u89HFGVY081529>