Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/pci Don't call ifmedia_ioctl with holding locks



details:   https://anonhg.NetBSD.org/src/rev/52888ef39713
branches:  trunk
changeset: 332738:52888ef39713
user:      ozaki-r <ozaki-r%NetBSD.org@localhost>
date:      Tue Oct 07 07:04:35 2014 +0000

description:
Don't call ifmedia_ioctl with holding locks

diffstat:

 sys/dev/pci/if_wm.c |  12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diffs (34 lines):

diff -r 324433a5d94a -r 52888ef39713 sys/dev/pci/if_wm.c
--- a/sys/dev/pci/if_wm.c       Tue Oct 07 06:44:38 2014 +0000
+++ b/sys/dev/pci/if_wm.c       Tue Oct 07 07:04:35 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_wm.c,v 1.301 2014/10/06 07:52:50 msaitoh Exp $      */
+/*     $NetBSD: if_wm.c,v 1.302 2014/10/07 07:04:35 ozaki-r Exp $      */
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -81,7 +81,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.301 2014/10/06 07:52:50 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.302 2014/10/07 07:04:35 ozaki-r Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -2677,7 +2677,15 @@
                        }
                        sc->sc_flowflags = ifr->ifr_media & IFM_ETH_FMASK;
                }
+               WM_BOTH_UNLOCK(sc);
+#ifdef WM_MPSAFE
+               s = splnet();
+#endif
                error = ifmedia_ioctl(ifp, ifr, &sc->sc_mii.mii_media, cmd);
+#ifdef WM_MPSAFE
+               splx(s);
+#endif
+               WM_BOTH_LOCK(sc);
                break;
        case SIOCINITIFADDR:
                if (ifa->ifa_addr->sa_family == AF_LINK) {



Home | Main Index | Thread Index | Old Index