Module Name:    src
Committed By:   isaki
Date:           Sat Feb 29 07:13:37 UTC 2020

Modified Files:
        src/sys/dev/audio: audio.c

Log Message:
Release memories on audiobellclose.
It's rest of the last commit.


To generate a diff of this commit:
cvs rdiff -u -r1.56 -r1.57 src/sys/dev/audio/audio.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/audio/audio.c
diff -u src/sys/dev/audio/audio.c:1.56 src/sys/dev/audio/audio.c:1.57
--- src/sys/dev/audio/audio.c:1.56	Sun Feb 23 07:17:01 2020
+++ src/sys/dev/audio/audio.c	Sat Feb 29 07:13:37 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: audio.c,v 1.56 2020/02/23 07:17:01 isaki Exp $	*/
+/*	$NetBSD: audio.c,v 1.57 2020/02/29 07:13:37 isaki Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -142,7 +142,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.56 2020/02/23 07:17:01 isaki Exp $");
+__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.57 2020/02/29 07:13:37 isaki Exp $");
 
 #ifdef _KERNEL_OPT
 #include "audio.h"
@@ -1956,6 +1956,11 @@ audiobellclose(audio_file_t *file)
 	error = audio_close(sc, file);
 
 	audio_file_exit(sc, &sc_ref);
+
+	KASSERT(file->ptrack);
+	audio_track_destroy(file->ptrack);
+	KASSERT(file->rtrack == NULL);
+	kmem_free(file, sizeof(*file));
 	return error;
 }
 

Reply via email to