Source-Changes-HG archive

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

[src/netbsd-6]: src/sys/dev/pci/hdaudio Pull up following revision(s) (reques...



details:   https://anonhg.NetBSD.org/src/rev/051267098874
branches:  netbsd-6
changeset: 773925:051267098874
user:      bouyer <bouyer%NetBSD.org@localhost>
date:      Sat Mar 17 17:26:07 2012 +0000

description:
Pull up following revision(s) (requested by lars in ticket #111):
        sys/dev/pci/hdaudio/hdafg.c: revision 1.16
call kmem_free with the right address in hdafg_detach for sc_widgets
the former code let to memory corruption

diffstat:

 sys/dev/pci/hdaudio/hdafg.c |  12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diffs (41 lines):

diff -r 6d4e19399f6f -r 051267098874 sys/dev/pci/hdaudio/hdafg.c
--- a/sys/dev/pci/hdaudio/hdafg.c       Sat Mar 17 17:24:22 2012 +0000
+++ b/sys/dev/pci/hdaudio/hdafg.c       Sat Mar 17 17:26:07 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: hdafg.c,v 1.15 2011/12/21 02:16:57 jmcneill Exp $ */
+/* $NetBSD: hdafg.c,v 1.15.2.1 2012/03/17 17:26:07 bouyer Exp $ */
 
 /*
  * Copyright (c) 2009 Precedence Technologies Ltd <support%precedence.co.uk@localhost>
@@ -60,7 +60,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: hdafg.c,v 1.15 2011/12/21 02:16:57 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hdafg.c,v 1.15.2.1 2012/03/17 17:26:07 bouyer Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -3733,7 +3733,7 @@
 hdafg_detach(device_t self, int flags)
 {
        struct hdafg_softc *sc = device_private(self);
-       struct hdaudio_widget *w = sc->sc_widgets;
+       struct hdaudio_widget *wl, *w = sc->sc_widgets;
        struct hdaudio_assoc *as = sc->sc_assocs;
        struct hdaudio_control *ctl = sc->sc_ctls;
        struct hdaudio_mixer *mx = sc->sc_mixers;
@@ -3755,10 +3755,10 @@
 
        /* restore bios pin widget configuration */
        for (nid = sc->sc_startnode; nid < sc->sc_endnode; nid++) {
-               w = hdafg_widget_lookup(sc, nid);               
-               if (w == NULL || w->w_type != COP_AWCAP_TYPE_PIN_COMPLEX)
+               wl = hdafg_widget_lookup(sc, nid);              
+               if (wl == NULL || wl->w_type != COP_AWCAP_TYPE_PIN_COMPLEX)
                        continue;
-               hdafg_widget_setconfig(w, w->w_pin.biosconfig);
+               hdafg_widget_setconfig(wl, wl->w_pin.biosconfig);
        }
 
        if (w)



Home | Main Index | Thread Index | Old Index