summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2017-02-07 10:08:22 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2017-02-07 10:08:22 +0000
commit4ca28a5fbf9c38f6a6b899f13dfd29d00c05f0f6 (patch)
tree108c2f5d91986e08c687d514fbd3290b82f20a37 /sys/dev
parent6b9aee2bb46f3c762a9cd44d49e8088254b932bd (diff)
Release the NET_LOCK() before entering per-driver ioctl() routine.
This prevents a deadlock with the X server and some wireless drivers. The real fix is to take unix domain socket code out of the NET_LOCK(). Issue reported by pirofti@ and ajacoutot@ ok tb@, stsp@, pirofti@
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/pci/if_iwm.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/sys/dev/pci/if_iwm.c b/sys/dev/pci/if_iwm.c
index 21ace7310a4..38ee48b35a9 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.162 2017/02/04 19:20:59 guenther Exp $ */
+/* $OpenBSD: if_iwm.c,v 1.163 2017/02/07 10:08:21 mpi Exp $ */
/*
* Copyright (c) 2014, 2016 genua gmbh <info@genua.de>
@@ -6133,18 +6133,13 @@ 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) {
- rw_enter_write(&netlock);
+ if (err)
return err;
- }
s = splnet();
@@ -6190,7 +6185,6 @@ iwm_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
splx(s);
rw_exit(&sc->ioctl_rwl);
- rw_enter_write(&netlock);
return err;
}