* [PATCH] ASoC: topology: Correct error handling in soc_tplg_dapm_widget_create()
@ 2022-03-31 11:49 Peter Ujfalusi
2022-04-05 9:31 ` Mark Brown
0 siblings, 1 reply; 2+ messages in thread
From: Peter Ujfalusi @ 2022-03-31 11:49 UTC (permalink / raw)
To: lgirdwood, broonie, pierre-louis.bossart, jaska.uimonen
Cc: alsa-devel, ranjani.sridharan
Academic correction of error handling:
In case the allocation of kc or kcontrol_type fails the correct label to
jump is hdr_err since the template.sname has been also allocated at this
point.
Fixes: d29d41e28eea6 ("ASoC: topology: Add support for multiple kcontrol types to a widget")
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
---
sound/soc/soc-topology.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c
index 72e50df7052c..3bb90a819650 100644
--- a/sound/soc/soc-topology.c
+++ b/sound/soc/soc-topology.c
@@ -1436,12 +1436,12 @@ static int soc_tplg_dapm_widget_create(struct soc_tplg *tplg,
template.num_kcontrols = le32_to_cpu(w->num_kcontrols);
kc = devm_kcalloc(tplg->dev, le32_to_cpu(w->num_kcontrols), sizeof(*kc), GFP_KERNEL);
if (!kc)
- goto err;
+ goto hdr_err;
kcontrol_type = devm_kcalloc(tplg->dev, le32_to_cpu(w->num_kcontrols), sizeof(unsigned int),
GFP_KERNEL);
if (!kcontrol_type)
- goto err;
+ goto hdr_err;
for (i = 0; i < le32_to_cpu(w->num_kcontrols); i++) {
control_hdr = (struct snd_soc_tplg_ctl_hdr *)tplg->pos;
--
2.35.1
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] ASoC: topology: Correct error handling in soc_tplg_dapm_widget_create()
2022-03-31 11:49 [PATCH] ASoC: topology: Correct error handling in soc_tplg_dapm_widget_create() Peter Ujfalusi
@ 2022-04-05 9:31 ` Mark Brown
0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2022-04-05 9:31 UTC (permalink / raw)
To: jaska.uimonen, pierre-louis.bossart, peter.ujfalusi, lgirdwood
Cc: alsa-devel, ranjani.sridharan
On Thu, 31 Mar 2022 14:49:57 +0300, Peter Ujfalusi wrote:
> Academic correction of error handling:
> In case the allocation of kc or kcontrol_type fails the correct label to
> jump is hdr_err since the template.sname has been also allocated at this
> point.
>
>
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Thanks!
[1/1] ASoC: topology: Correct error handling in soc_tplg_dapm_widget_create()
commit: 9c363532413cda3e2c6dfa10e5cca7cd221877a0
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-04-05 9:37 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-31 11:49 [PATCH] ASoC: topology: Correct error handling in soc_tplg_dapm_widget_create() Peter Ujfalusi
2022-04-05 9:31 ` Mark Brown
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.