kernel_optimize_test/sound/core
Laurent Pinchart f41ced8f10 Check fops_get() return value
Several subsystem open handlers dereference the fops_get() return value
without checking it for nullness.  This opens a race condition between the
open handler and module unloading.

A module can be marked as being unloaded (MODULE_STATE_GOING) before its
exit function is called and gets the chance to unregister the driver.
During that window open handlers can still be called, and fops_get() will
fail in try_module_get() and return a NULL pointer.

This change checks the fops_get() return value and returns -ENODEV if NULL.

Reported-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
Signed-off-by: Laurent Pinchart <laurent.pinchart@skynet.be>
Acked-by: Takashi Iwai <tiwai@suse.de>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Dave Airlie <airlied@linux.ie>
Acked-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-01-06 15:59:11 -08:00
..
oss
seq
control_compat.c
control.c
device.c
hrtimer.c Merge branch 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2008-12-30 16:16:21 -08:00
hwdep_compat.c
hwdep.c
info_oss.c
info.c ALSA: when card identification is changed, change also /proc/asound symlink 2008-11-12 17:07:37 +01:00
init.c sound: Fix warnings relating to ignored return value in snd_card_register 2008-11-18 18:27:58 +01:00
isadma.c
jack.c Merge branch 'topic/jack-mechanical' into to-push 2008-12-25 11:40:29 +01:00
Kconfig
Makefile
memalloc.c
memory.c
misc.c
pcm_compat.c
pcm_lib.c
pcm_memory.c
pcm_misc.c
pcm_native.c
pcm_timer.c
pcm.c
rawmidi_compat.c
rawmidi.c ALSA: hda - Convert from takslet_hi_schedule() to tasklet_schedule() 2008-12-18 12:17:55 +01:00
rtctimer.c ALSA: hda - Convert from takslet_hi_schedule() to tasklet_schedule() 2008-12-18 12:17:55 +01:00
sgbuf.c
sound_oss.c
sound.c Check fops_get() return value 2009-01-06 15:59:11 -08:00
timer_compat.c
timer.c ALSA: hda - Convert from takslet_hi_schedule() to tasklet_schedule() 2008-12-18 12:17:55 +01:00
vmaster.c