svn commit: r232147 - head/sys/dev/wi
Pawel Jakub Dawidek
pjd at FreeBSD.org
Sun Feb 26 00:06:50 UTC 2012
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
>
> Log:
> If an interrupt is received with no vap attached, just fail LINK events.
>
> This fixes a NULL pointer dereference which occurs if the vap list is
> empty but someone brings up the wi0 interface.
>
> Modified:
> head/sys/dev/wi/if_wi.c
>
> Modified: head/sys/dev/wi/if_wi.c
> ==============================================================================
> --- 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 == NULL)
> + goto finish;
> +
> switch (le16toh(stat)) {
> case WI_INFO_LINK_STAT_CONNECTED:
> if (vap->iv_state == 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?
--
Pawel Jakub Dawidek http://www.wheelsystems.com
FreeBSD committer http://www.FreeBSD.org
Am I Evil? Yes, I Am! http://tupytaj.pl
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/svn-src-head/attachments/20120226/e9403a65/attachment.pgp
More information about the svn-src-head
mailing list