Module Name: src
Committed By: jmcneill
Date: Mon Nov 28 11:46:54 UTC 2011
Modified Files:
src/sys/dev/ic: cs4231.c
Log Message:
PR# kern/45664: audio panic at detach
Pass the size of the structure to kmem_free, not the size of the DMA
buffer.
To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/sys/dev/ic/cs4231.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/ic/cs4231.c
diff -u src/sys/dev/ic/cs4231.c:1.27 src/sys/dev/ic/cs4231.c:1.28
--- src/sys/dev/ic/cs4231.c:1.27 Wed Nov 23 23:07:32 2011
+++ src/sys/dev/ic/cs4231.c Mon Nov 28 11:46:54 2011
@@ -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 @@ fail3:
fail2:
bus_dmamap_destroy(dmatag, p->dmamap);
fail1:
- kmem_free(p, size);
+ kmem_free(p, sizeof(*p));
return NULL;
}
@@ -242,7 +242,7 @@ cs4231_free(void *addr, void *ptr, size_
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");