]> git.baikalelectronics.ru Git - kernel.git/commit
ALSA: asihpi - Unsafe memory management when allocating control cache
authorJesper Juhl <jj@chaosbits.net>
Fri, 29 Oct 2010 19:35:25 +0000 (21:35 +0200)
committerTakashi Iwai <tiwai@suse.de>
Tue, 2 Nov 2010 06:38:21 +0000 (07:38 +0100)
commit9816cffcd0b734358072ad8c5a6f52034dac04f6
tree6a851561a7a67d660f5ce5260f6e6429fed0eccc
parent5b200b700376719ddc3d3367785cea2ec8ec936c
ALSA: asihpi - Unsafe memory management when allocating control cache

I noticed that sound/pci/asihpi/hpicmn.c::hpi_alloc_control_cache() does
not check the return value from kmalloc(), which may fail.
If kmalloc() fails we'll dereference a null pointer and things will go bad
fast.
There are two memory allocations in that function and there's also the
problem that the first may succeed and the second may fail and nothing is
done about that either which will also go wrong down the line.

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Acked-by: Eliot Blennerhassett <linux@audioscience.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/asihpi/hpi6000.c
sound/pci/asihpi/hpi6205.c
sound/pci/asihpi/hpicmn.c