Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/ic PR# kern/45664: audio panic at detach



details:   https://anonhg.NetBSD.org/src/rev/16b381b82f35
branches:  trunk
changeset: 771680:16b381b82f35
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Mon Nov 28 11:46:54 2011 +0000

description:
PR# kern/45664: audio panic at detach

Pass the size of the structure to kmem_free, not the size of the DMA
buffer.

diffstat:

 sys/dev/ic/cs4231.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (36 lines):

diff -r 2441531d4a20 -r 16b381b82f35 sys/dev/ic/cs4231.c
--- a/sys/dev/ic/cs4231.c       Mon Nov 28 10:10:10 2011 +0000
+++ b/sys/dev/ic/cs4231.c       Mon Nov 28 11:46:54 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cs4231.c,v 1.27 2011/11/23 23:07:32 jmcneill Exp $     */
+/*     $NetBSD: cs4231.c,v 1.28 2011/11/28 11:46:54 jmcneill Exp $     */
 
 /*-
  * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cs4231.c,v 1.27 2011/11/23 23:07:32 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cs4231.c,v 1.28 2011/11/28 11:46:54 jmcneill Exp $");
 
 #include "audio.h"
 #if NAUDIO > 0
@@ -221,7 +221,7 @@
 fail2:
        bus_dmamap_destroy(dmatag, p->dmamap);
 fail1:
-       kmem_free(p, size);
+       kmem_free(p, sizeof(*p));
        return NULL;
 }
 
@@ -242,7 +242,7 @@
                bus_dmamem_free(dmatag, p->segs, p->nsegs);
                bus_dmamap_destroy(dmatag, p->dmamap);
                *pp = p->next;
-               kmem_free(p, size);
+               kmem_free(p, sizeof(*p));
                return;
        }
        printf("cs4231_free: rogue pointer\n");



Home | Main Index | Thread Index | Old Index