android_kernel_samsung_msm8976/sound
Wenwen Wang 407425bb9b sound: fix a memory leak bug
commit c7cd7c748a3250ca33509f9235efab9c803aca09 upstream.

In sound_insert_unit(), the controlling structure 's' is allocated through
kmalloc(). Then it is added to the sound driver list by invoking
__sound_insert_unit(). Later on, if __register_chrdev() fails, 's' is
removed from the list through __sound_remove_unit(). If 'index' is not less
than 0, -EBUSY is returned to indicate the error. However, 's' is not
deallocated on this execution path, leading to a memory leak bug.

To fix the above issue, free 's' before -EBUSY is returned.

Change-Id: I47c3baf7ad029e4c36db0540b2b0010599975256
Signed-off-by: Wenwen Wang <wenwen@cs.uga.edu>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
2020-01-19 20:49:18 +01:00
..
aoa
arm
atmel
core ALSA: Refactor slot assignment code 2020-01-16 22:34:41 +01:00
drivers ALSA: aloop: Fix racy hw constraints adjustment 2019-07-27 21:46:27 +02:00
firewire
i2c
isa
mips
oss
parisc
pci This is the 3.10.102 stable release 2017-04-18 17:22:08 +02:00
pcmcia
ppc
sh
soc soc: msm-pcm: Add missing mutex lock to protect prvt data 2019-11-26 00:06:53 +01:00
sparc
spi
synth ALSA: emux: Fix potential Spectre v1 vulnerabilities 2019-07-27 22:09:03 +02:00
usb ALSA: usb-audio: Fix UAF decrement if card has no live interfaces in card.c 2019-10-19 23:31:29 +02:00
ac97_bus.c
Kconfig
last.c
Makefile
sound_core.c sound: fix a memory leak bug 2020-01-19 20:49:18 +01:00
sound_firmware.c