From mboxrd@z Thu Jan 1 00:00:00 1970 From: Takashi Iwai Subject: Re: memory leaks? Date: Wed, 30 Mar 2005 14:08:05 +0200 Message-ID: References: <1111896886.2408.1.camel@mindpipe> <1112127843.5141.12.camel@mindpipe> <1112131916.5386.6.camel@mindpipe> Mime-Version: 1.0 (generated by SEMI 1.14.5 - "Awara-Onsen") Content-Type: multipart/mixed; boundary="Multipart_Wed_Mar_30_14:08:05_2005-1" Return-path: In-Reply-To: <1112131916.5386.6.camel@mindpipe> Sender: alsa-devel-admin@lists.sourceforge.net Errors-To: alsa-devel-admin@lists.sourceforge.net List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , List-Archive: To: Lee Revell Cc: alsa-devel List-Id: alsa-devel@alsa-project.org --Multipart_Wed_Mar_30_14:08:05_2005-1 Content-Type: text/plain; charset=US-ASCII At Tue, 29 Mar 2005 16:31:56 -0500, Lee Revell wrote: > > On Tue, 2005-03-29 at 15:24 -0500, Lee Revell wrote: > > On Tue, 2005-03-29 at 14:27 +0200, Takashi Iwai wrote: > > > Yes. Could you trace the corresponding addresses? > > > (just checking /proc/kallsyms before unloading would help, too). > > > > How exactly would I trace those addresses? > > > > Anyway, it looks to me that the leak is in snd_seq_midi. Here is the > > most recent output. The first one I'm not sure about, the second seems > > to be in snd_seq_midisynth_register_port. > > I might have found it. The info structure allocated in > snd_seq_midisynth_register_port does not seem to be freed in > snd_seq_midisynth_unregister_port, except on the error paths. Nice catch. Does the patch below fix the problem? Takashi --Multipart_Wed_Mar_30_14:08:05_2005-1 Content-Type: text/plain; charset=US-ASCII Index: alsa-kernel/core/seq/seq_midi.c =================================================================== RCS file: /home/iwai/cvs/alsa/alsa-kernel/core/seq/seq_midi.c,v retrieving revision 1.26 diff -u -r1.26 seq_midi.c --- alsa-kernel/core/seq/seq_midi.c 22 Mar 2005 15:21:18 -0000 1.26 +++ alsa-kernel/core/seq/seq_midi.c 30 Mar 2005 12:07:12 -0000 @@ -414,6 +414,7 @@ if (newclient) synths[card->number] = client; up(®ister_mutex); + kfree(info); return 0; /* success */ __nomem: --Multipart_Wed_Mar_30_14:08:05_2005-1-- ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click