diff options
author | Yu Liao <liaoyu15@huawei.com> | 2022-03-18 10:16:16 +0800 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2022-04-07 18:29:37 +0100 |
commit | 9b91d0ece22b9ab37fc185511c7f992e51c93d6e (patch) | |
tree | ae5b1f2074283728d81faea0e92a47903b17e225 /sound/soc/codecs/pcm3008.h | |
parent | 20744617bdbafe2e7fb7bf5401f616e24bde4471 (diff) |
ASoC: SOF: topology: Fix memory leak in sof_control_load()
scontrol doesn't get freed when kstrdup returns NULL.
Fix by free iscontrol in that case.
scontrol = kzalloc(sizeof(*scontrol), GFP_KERNEL);
if (!scontrol)
return -ENOMEM;
scontrol->name = kstrdup(hdr->name, GFP_KERNEL);
if (!scontrol->name)
return -ENOMEM;
Signed-off-by: Yu Liao <liaoyu15@huawei.com>
Link: https://lore.kernel.org/r/20220318021616.2599630-1-liaoyu15@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/codecs/pcm3008.h')
0 files changed, 0 insertions, 0 deletions