Date: Mon, 5 Dec 2016 19:37:15 +0000 (UTC) From: John Baldwin <jhb@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r309559 - in stable: 10/sys/dev/cxgbe 11/sys/dev/cxgbe Message-ID: <201612051937.uB5JbFBu052858@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jhb Date: Mon Dec 5 19:37:15 2016 New Revision: 309559 URL: https://svnweb.freebsd.org/changeset/base/309559 Log: MFC 305667: 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: stable/10/sys/dev/cxgbe/t4_main.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/dev/cxgbe/t4_main.c Directory Properties: stable/11/ (props changed) Modified: stable/10/sys/dev/cxgbe/t4_main.c ============================================================================== --- stable/10/sys/dev/cxgbe/t4_main.c Mon Dec 5 19:34:52 2016 (r309558) +++ stable/10/sys/dev/cxgbe/t4_main.c Mon Dec 5 19:37:15 2016 (r309559) @@ -8726,6 +8726,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?201612051937.uB5JbFBu052858>