kernel-ark/sound
Jaswinder Singh Rajput f96e080821 ALSA: 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:
    [<c108ac5c>] create_object+0x135/0x204
    [<c108adfe>] kmemleak_alloc+0x26/0x4c
    [<c1087de2>] kmem_cache_alloc+0x72/0xff
    [<c126d2ac>] seq_create_client1+0x22/0x160
    [<c126e3b6>] snd_seq_create_kernel_client+0x72/0xef
    [<c1485a05>] snd_seq_oss_create_client+0x86/0x142
    [<c1485920>] alsa_seq_oss_init+0xf6/0x155
    [<c1001059>] do_one_initcall+0x4f/0x111
    [<c14655be>] kernel_init+0x115/0x166
    [<c10032af>] kernel_thread_helper+0x7/0x10
    [<ffffffff>] 0xffffffff
unreferenced object 0xf688a580 (size 64):
  comm "swapper", pid 1, jiffies 4294670753
  backtrace:
    [<c108ac5c>] create_object+0x135/0x204
    [<c108adfe>] kmemleak_alloc+0x26/0x4c
    [<c1087de2>] kmem_cache_alloc+0x72/0xff
    [<c126f964>] snd_seq_pool_new+0x1c/0xb8
    [<c126d311>] seq_create_client1+0x87/0x160
    [<c126e3b6>] snd_seq_create_kernel_client+0x72/0xef
    [<c1485a05>] snd_seq_oss_create_client+0x86/0x142
    [<c1485920>] alsa_seq_oss_init+0xf6/0x155
    [<c1001059>] do_one_initcall+0x4f/0x111
    [<c14655be>] kernel_init+0x115/0x166
    [<c10032af>] kernel_thread_helper+0x7/0x10
    [<ffffffff>] 0xffffffff
unreferenced object 0xf6b0e480 (size 256):
  comm "swapper", pid 1, jiffies 4294670754
  backtrace:
    [<c108ac5c>] create_object+0x135/0x204
    [<c108adfe>] kmemleak_alloc+0x26/0x4c
    [<c1087de2>] kmem_cache_alloc+0x72/0xff
    [<c12725a0>] snd_seq_create_port+0x51/0x21c
    [<c126de50>] snd_seq_ioctl_create_port+0x57/0x13c
    [<c126d07a>] snd_seq_do_ioctl+0x4a/0x69
    [<c126d0de>] snd_seq_kernel_client_ctl+0x33/0x49
    [<c1485a74>] snd_seq_oss_create_client+0xf5/0x142
    [<c1485920>] alsa_seq_oss_init+0xf6/0x155
    [<c1001059>] do_one_initcall+0x4f/0x111
    [<c14655be>] kernel_init+0x115/0x166
    [<c10032af>] kernel_thread_helper+0x7/0x10
    [<ffffffff>] 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 <jaswinderrajput@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-07-19 19:10:01 +02:00
..
aoa sound: remove driver_data direct access of struct device 2009-05-12 09:20:54 +02:00
arm [ARM] 5544/1: Trust PrimeCell resource sizes 2009-06-11 15:36:56 +01:00
atmel ALSA: snd-atmel-abdac: increase periods_min to 6 instead of 4 2009-04-06 03:56:28 +02:00
core ALSA: OSS sequencer should be initialized after snd_seq_system_client_init 2009-07-19 19:10:01 +02:00
drivers time: move PIT_TICK_RATE to linux/timex.h 2009-06-16 19:47:27 -07:00
i2c V4L/DVB (10771): tea575x-tuner: convert it to V4L2 API 2009-03-30 12:43:02 -03:00
isa ALSA: sound/isa: convert nested spin_lock_irqsave to spin_lock 2009-07-19 14:02:29 +02:00
mips ALSA: sgio2audio.c: clean up checking 2009-06-07 09:08:43 +02:00
oss time: move PIT_TICK_RATE to linux/timex.h 2009-06-16 19:47:27 -07:00
parisc Merge branch 'topic/section-fix' into for-linus 2009-06-10 07:26:46 +02:00
pci ALSA: riptide - proper handling of pci_register_driver for joystick 2009-07-15 14:00:40 +02:00
pcmcia ALSA: Add missing SNDRV_PCM_INFO_BATCH flag to some drivers 2009-04-28 15:06:44 +02:00
ppc Merge branch 'topic/ps3' into for-linus 2009-06-12 20:03:16 +02:00
sh trivial: Fix misspelling of firmware 2009-03-30 15:21:59 +02:00
soc Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6 2009-06-23 10:45:39 -07:00
sparc ALSA: Add missing SNDRV_PCM_INFO_BATCH flag to some drivers 2009-04-28 15:06:44 +02:00
spi ALSA: Convert to snd_card_create() in other sound/* 2009-01-12 15:21:19 +01:00
synth ALSA: clean up the logic for building sequencer modules 2009-05-29 11:49:42 +02:00
usb Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6 2009-06-21 13:13:08 -07:00
ac97_bus.c
Kconfig ALSA: Add Atmel ALSA drivers directory 2009-02-05 15:08:53 +01:00
last.c
Makefile ALSA: Add Atmel ALSA drivers directory 2009-02-05 15:08:53 +01:00
sound_core.c Driver Core: sound: add nodename for sound drivers 2009-06-15 21:30:26 -07:00
sound_firmware.c