mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-22 02:20:40 +00:00
staging: greybus: audio: Fix possible leak free widgets in gbaudio_dapm_free_controls
[ Upstream commite77b259f67
] In gbaudio_dapm_free_controls(), if one of the widgets is not found, an error will be returned directly, which will cause the rest to be unable to be freed, resulting in leak. This patch fixes the bug. If if one of them is not found, just skip and free the others. Fixes:510e340efe
("staging: greybus: audio: Add helper APIs for dynamic audio module") Reported-by: Hulk Robot <hulkci@huawei.com> Reviewed-by: Vaibhav Agarwal <vaibhav.sr@gmail.com> Signed-off-by: Wang Hai <wanghai38@huawei.com> Link: https://lore.kernel.org/r/20201205103827.31244-1-wanghai38@huawei.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
b4db71c2d7
commit
f636755d7f
1 changed files with 2 additions and 1 deletions
|
@ -135,7 +135,8 @@ int gbaudio_dapm_free_controls(struct snd_soc_dapm_context *dapm,
|
|||
if (!w) {
|
||||
dev_err(dapm->dev, "%s: widget not found\n",
|
||||
widget->name);
|
||||
return -EINVAL;
|
||||
widget++;
|
||||
continue;
|
||||
}
|
||||
widget++;
|
||||
#ifdef CONFIG_DEBUG_FS
|
||||
|
|
Loading…
Reference in a new issue