linux/sound/aoa
Yang Yingliang 4a4c8482e3 ALSA: aoa: i2sbus: fix possible memory leak in i2sbus_add_dev()
dev_set_name() in soundbus_add_one() allocates memory for name, it need be
freed when of_device_register() fails, call soundbus_dev_put() to give up
the reference that hold in device_initialize(), so that it can be freed in
kobject_cleanup() when the refcount hit to 0. And other resources are also
freed in i2sbus_release_dev(), so it can return 0 directly.

Fixes: f3d9478b2c ("[ALSA] snd-aoa: add snd-aoa")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20221027013438.991920-1-yangyingliang@huawei.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2022-10-27 08:27:39 +02:00
..
codecs i2c: Make remove callback return void 2022-08-16 12:46:26 +02:00
core ALSA: Convert strlcpy to strscpy when return value is unused 2021-01-08 09:30:05 +01:00
fabrics ALSA: Convert strlcpy to strscpy when return value is unused 2021-01-08 09:30:05 +01:00
soundbus ALSA: aoa: i2sbus: fix possible memory leak in i2sbus_add_dev() 2022-10-27 08:27:39 +02:00
aoa-gpio.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 250 2019-06-19 17:09:08 +02:00
aoa.h ALSA: aoa: Constify snd_device_ops definitions 2020-01-03 09:24:01 +01:00
Kconfig treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00