Skip to content
Unverified Commit e9441675 authored by Yang Yingliang's avatar Yang Yingliang Committed by Mark Brown
Browse files

ASoC: SOF: Intel: hda-codec: fix possible memory leak in hda_codec_device_init()

If snd_hdac_device_register() fails, 'codec' and name allocated in
dev_set_name() called in snd_hdac_device_init() are leaked. Fix this
by calling put_device(), so they can be freed in snd_hda_codec_dev_release()
and kobject_cleanup().

Fixes: 829c6731 ("ASoC: SOF: Intel: Introduce HDA codec init and exit routines")
Fixes: dfe66a18

 ("ALSA: hdac_ext: add extended HDA bus")
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
Reviewed-by: default avatarKai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20221020110157.1450191-1-yangyingliang@huawei.com
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent a75481fa
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment