From owner-svn-src-all@FreeBSD.ORG Sun Feb 26 00:06:50 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BA40C106566C; Sun, 26 Feb 2012 00:06:50 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id 661198FC08; Sun, 26 Feb 2012 00:06:49 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id 467D3B43; Sun, 26 Feb 2012 01:06:48 +0100 (CET) Date: Sun, 26 Feb 2012 01:05:29 +0100 From: Pawel Jakub Dawidek To: Adrian Chadd Message-ID: <20120226000529.GK1344@garage.freebsd.pl> References: <201202250801.q1P81Tdx006994@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="SLauP2uySp+9cKYP" Content-Disposition: inline In-Reply-To: <201202250801.q1P81Tdx006994@svn.freebsd.org> X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r232147 - head/sys/dev/wi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Feb 2012 00:06:50 -0000 --SLauP2uySp+9cKYP Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Feb 25, 2012 at 08:01:29AM +0000, Adrian Chadd wrote: > Author: adrian > Date: Sat Feb 25 08:01:29 2012 > New Revision: 232147 > URL: http://svn.freebsd.org/changeset/base/232147 >=20 > Log: > If an interrupt is received with no vap attached, just fail LINK events. > =20 > This fixes a NULL pointer dereference which occurs if the vap list is > empty but someone brings up the wi0 interface. >=20 > Modified: > head/sys/dev/wi/if_wi.c >=20 > 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 Sat Feb 25 07:58:59 2012 (r232146) > +++ head/sys/dev/wi/if_wi.c Sat Feb 25 08:01:29 2012 (r232147) > @@ -1511,6 +1511,10 @@ wi_info_intr(struct wi_softc *sc) > case WI_INFO_LINK_STAT: > wi_read_bap(sc, fid, sizeof(ltbuf), &stat, sizeof(stat)); > DPRINTF(("wi_info_intr: LINK_STAT 0x%x\n", le16toh(stat))); > + > + if (vap =3D=3D NULL) > + goto finish; > + > switch (le16toh(stat)) { > case WI_INFO_LINK_STAT_CONNECTED: > if (vap->iv_state =3D=3D IEEE80211_S_RUN && > @@ -1566,6 +1570,7 @@ wi_info_intr(struct wi_softc *sc) > le16toh(ltbuf[1]), le16toh(ltbuf[0]))); > break; > } > +finish: > CSR_WRITE_2(sc, WI_EVENT_ACK, WI_EV_INFO); > } Can't you just 'break' instead of using goto? --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --SLauP2uySp+9cKYP Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iEYEARECAAYFAk9Jd0kACgkQForvXbEpPzRwwACgsmQR8LYDIP9xEkvb0MVeYIjQ ruIAn2WksOvKx0y5I6GDeLPfp/LSWLOm =7Co+ -----END PGP SIGNATURE----- --SLauP2uySp+9cKYP--