Date: Sat, 25 Feb 2012 23:24:06 -0800 From: Adrian Chadd <adrian@freebsd.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r232147 - head/sys/dev/wi Message-ID: <CAJ-VmokH8=HCK_O6YWSWSR6KzavpXqjenxpmJNAe_4Qv_0HkTw@mail.gmail.com> In-Reply-To: <201202250801.q1P81Tdx006994@svn.freebsd.org> References: <201202250801.q1P81Tdx006994@svn.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
Good point.. Adiran On 25 February 2012 00:01, Adrian Chadd <adrian@freebsd.org> wrote: > Author: adrian > Date: Sat Feb 25 08:01:29 2012 > New Revision: 232147 > URL: http://svn.freebsd.org/changeset/base/232147 > > Log: > =A0If an interrupt is received with no vap attached, just fail LINK event= s. > > =A0This fixes a NULL pointer dereference which occurs if the vap list is > =A0empty but someone brings up the wi0 interface. > > Modified: > =A0head/sys/dev/wi/if_wi.c > > Modified: head/sys/dev/wi/if_wi.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/wi/if_wi.c =A0 =A0 Sat Feb 25 07:58:59 2012 =A0 =A0 =A0 = =A0(r232146) > +++ head/sys/dev/wi/if_wi.c =A0 =A0 Sat Feb 25 08:01:29 2012 =A0 =A0 =A0 = =A0(r232147) > @@ -1511,6 +1511,10 @@ wi_info_intr(struct wi_softc *sc) > =A0 =A0 =A0 =A0case WI_INFO_LINK_STAT: > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0wi_read_bap(sc, fid, sizeof(ltbuf), &stat,= sizeof(stat)); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0DPRINTF(("wi_info_intr: LINK_STAT 0x%x\n",= le16toh(stat))); > + > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (vap =3D=3D NULL) > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 goto finish; > + > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0switch (le16toh(stat)) { > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0case WI_INFO_LINK_STAT_CONNECTED: > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (vap->iv_state =3D=3D I= EEE80211_S_RUN && > @@ -1566,6 +1570,7 @@ wi_info_intr(struct wi_softc *sc) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0le16toh(ltbuf[1]), le16toh(ltbuf[0= ]))); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0break; > =A0 =A0 =A0 =A0} > +finish: > =A0 =A0 =A0 =A0CSR_WRITE_2(sc, WI_EVENT_ACK, WI_EV_INFO); > =A0} >
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAJ-VmokH8=HCK_O6YWSWSR6KzavpXqjenxpmJNAe_4Qv_0HkTw>