Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/usb Fix race in attachment.
details: https://anonhg.NetBSD.org/src/rev/3fba45494684
branches: trunk
changeset: 445807:3fba45494684
user: mlelstv <mlelstv%NetBSD.org@localhost>
date: Tue Nov 13 10:35:32 2018 +0000
description:
Fix race in attachment.
diffstat:
sys/dev/usb/if_urtwn.c | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
diffs (37 lines):
diff -r 5949601cb2c2 -r 3fba45494684 sys/dev/usb/if_urtwn.c
--- a/sys/dev/usb/if_urtwn.c Tue Nov 13 10:33:03 2018 +0000
+++ b/sys/dev/usb/if_urtwn.c Tue Nov 13 10:35:32 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_urtwn.c,v 1.64 2018/09/12 21:57:18 christos Exp $ */
+/* $NetBSD: if_urtwn.c,v 1.65 2018/11/13 10:35:32 mlelstv Exp $ */
/* $OpenBSD: if_urtwn.c,v 1.42 2015/02/10 23:25:46 mpi Exp $ */
/*-
@@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_urtwn.c,v 1.64 2018/09/12 21:57:18 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_urtwn.c,v 1.65 2018/11/13 10:35:32 mlelstv Exp $");
#ifdef _KERNEL_OPT
#include "opt_inet.h"
@@ -484,7 +484,7 @@
IFQ_SET_READY(&ifp->if_snd);
memcpy(ifp->if_xname, device_xname(sc->sc_dev), IFNAMSIZ);
- if_attach(ifp);
+ if_initialize(ifp);
ieee80211_ifattach(ic);
/* override default methods */
@@ -509,6 +509,9 @@
sc->sc_txtap.wt_ihdr.it_len = htole16(sc->sc_txtap_len);
sc->sc_txtap.wt_ihdr.it_present = htole32(URTWN_TX_RADIOTAP_PRESENT);
+ ifp->if_percpuq = if_percpuq_create(ifp);
+ if_register(ifp);
+
ieee80211_announce(ic);
usbd_add_drv_event(USB_EVENT_DRIVER_ATTACH, sc->sc_udev, sc->sc_dev);
Home |
Main Index |
Thread Index |
Old Index