summaryrefslogtreecommitdiff
path: root/sys/dev/pci/if_iwm.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/pci/if_iwm.c')
-rw-r--r--sys/dev/pci/if_iwm.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/sys/dev/pci/if_iwm.c b/sys/dev/pci/if_iwm.c
index 38ee48b35a9..e2133d22244 100644
--- a/sys/dev/pci/if_iwm.c
+++ b/sys/dev/pci/if_iwm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_iwm.c,v 1.163 2017/02/07 10:08:21 mpi Exp $ */
+/* $OpenBSD: if_iwm.c,v 1.164 2017/02/16 10:15:12 mpi Exp $ */
/*
* Copyright (c) 2014, 2016 genua gmbh <info@genua.de>
@@ -6133,13 +6133,18 @@ iwm_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
struct ifreq *ifr;
int s, err = 0;
+ /* XXXSMP breaks atomicity */
+ rw_exit_write(&netlock);
+
/*
* Prevent processes from entering this function while another
* process is tsleep'ing in it.
*/
err = rw_enter(&sc->ioctl_rwl, RW_WRITE | RW_INTR);
- if (err)
+ if (err) {
+ rw_enter_write(&netlock);
return err;
+ }
s = splnet();
@@ -6185,6 +6190,7 @@ iwm_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
splx(s);
rw_exit(&sc->ioctl_rwl);
+ rw_enter_write(&netlock);
return err;
}