Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754922AbZGSRLC (ORCPT ); Sun, 19 Jul 2009 13:11:02 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754735AbZGSRK7 (ORCPT ); Sun, 19 Jul 2009 13:10:59 -0400 Received: from cantor2.suse.de ([195.135.220.15]:45483 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754616AbZGSRK6 (ORCPT ); Sun, 19 Jul 2009 13:10:58 -0400 Date: Sun, 19 Jul 2009 19:10:57 +0200 Message-ID: From: Takashi Iwai To: Jaswinder Singh Rajput Cc: Mark Brown , Catalin Marinas , LKML , Sam Ravnborg Subject: Re: [PATCH] SOUND: OSS sequencer should be initialized after snd_seq_system_client_init In-Reply-To: <1248020914.2471.4.camel@ht.satnam> References: <1247861644.4513.15.camel@ht.satnam> <1248017194.2548.3.camel@ht.satnam> <1248020914.2471.4.camel@ht.satnam> User-Agent: Wanderlust/2.12.0 (Your Wildest Dreams) SEMI/1.14.6 (Maruoka) FLIM/1.14.7 (=?ISO-8859-4?Q?Sanj=F2?=) APEL/10.6 Emacs/22.3 (x86_64-suse-linux-gnu) MULE/5.0 (SAKAKI) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 4296 Lines: 119 At Sun, 19 Jul 2009 21:58:34 +0530, Jaswinder Singh Rajput wrote: > > On Sun, 2009-07-19 at 18:02 +0200, Takashi Iwai wrote: > > > Looks good. Could you give a changelog and your sign-off to merge? > > > > [PATCH] SOUND: OSS sequencer should be initialized after snd_seq_system_client_init > > When build SND_SEQUENCER in kernel then OSS sequencer(alsa_seq_oss_init) > is initialized before System (snd_seq_system_client_init) which leads to > memory leak : > > unreferenced object 0xf6b0e680 (size 256): > comm "swapper", pid 1, jiffies 4294670753 > backtrace: > [] create_object+0x135/0x204 > [] kmemleak_alloc+0x26/0x4c > [] kmem_cache_alloc+0x72/0xff > [] seq_create_client1+0x22/0x160 > [] snd_seq_create_kernel_client+0x72/0xef > [] snd_seq_oss_create_client+0x86/0x142 > [] alsa_seq_oss_init+0xf6/0x155 > [] do_one_initcall+0x4f/0x111 > [] kernel_init+0x115/0x166 > [] kernel_thread_helper+0x7/0x10 > [] 0xffffffff > unreferenced object 0xf688a580 (size 64): > comm "swapper", pid 1, jiffies 4294670753 > backtrace: > [] create_object+0x135/0x204 > [] kmemleak_alloc+0x26/0x4c > [] kmem_cache_alloc+0x72/0xff > [] snd_seq_pool_new+0x1c/0xb8 > [] seq_create_client1+0x87/0x160 > [] snd_seq_create_kernel_client+0x72/0xef > [] snd_seq_oss_create_client+0x86/0x142 > [] alsa_seq_oss_init+0xf6/0x155 > [] do_one_initcall+0x4f/0x111 > [] kernel_init+0x115/0x166 > [] kernel_thread_helper+0x7/0x10 > [] 0xffffffff > unreferenced object 0xf6b0e480 (size 256): > comm "swapper", pid 1, jiffies 4294670754 > backtrace: > [] create_object+0x135/0x204 > [] kmemleak_alloc+0x26/0x4c > [] kmem_cache_alloc+0x72/0xff > [] snd_seq_create_port+0x51/0x21c > [] snd_seq_ioctl_create_port+0x57/0x13c > [] snd_seq_do_ioctl+0x4a/0x69 > [] snd_seq_kernel_client_ctl+0x33/0x49 > [] snd_seq_oss_create_client+0xf5/0x142 > [] alsa_seq_oss_init+0xf6/0x155 > [] do_one_initcall+0x4f/0x111 > [] kernel_init+0x115/0x166 > [] kernel_thread_helper+0x7/0x10 > [] 0xffffffff > > The correct order should be : > > System (snd_seq_system_client_init) should be initialized before > OSS sequencer(alsa_seq_oss_init) which is equivalent to : > > 1. insmod sound/core/seq/snd-seq-device.ko > 2. insmod sound/core/seq/snd-seq.ko > 3. insmod sound/core/seq/snd-seq-midi-event.ko > 4. insmod sound/core/seq/oss/snd-seq-oss.ko > > Including sound/core/seq/oss/Makefile after other seq modules > fixes the ordering and memory leak. > > Signed-off-by: Jaswinder Singh Rajput Thanks, applied now. Takashi > --- > sound/core/seq/Makefile | 7 ++----- > 1 files changed, 2 insertions(+), 5 deletions(-) > > diff --git a/sound/core/seq/Makefile b/sound/core/seq/Makefile > index 1bcb360..941f64a 100644 > --- a/sound/core/seq/Makefile > +++ b/sound/core/seq/Makefile > @@ -3,10 +3,6 @@ > # Copyright (c) 1999 by Jaroslav Kysela > # > > -ifeq ($(CONFIG_SND_SEQUENCER_OSS),y) > - obj-$(CONFIG_SND_SEQUENCER) += oss/ > -endif > - > snd-seq-device-objs := seq_device.o > snd-seq-objs := seq.o seq_lock.o seq_clientmgr.o seq_memory.o seq_queue.o \ > seq_fifo.o seq_prioq.o seq_timer.o \ > @@ -19,7 +15,8 @@ snd-seq-virmidi-objs := seq_virmidi.o > > obj-$(CONFIG_SND_SEQUENCER) += snd-seq.o snd-seq-device.o > ifeq ($(CONFIG_SND_SEQUENCER_OSS),y) > -obj-$(CONFIG_SND_SEQUENCER) += snd-seq-midi-event.o > + obj-$(CONFIG_SND_SEQUENCER) += snd-seq-midi-event.o > + obj-$(CONFIG_SND_SEQUENCER) += oss/ > endif > obj-$(CONFIG_SND_SEQ_DUMMY) += snd-seq-dummy.o > > -- > 1.6.0.6 > > > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/