Skip to content

Commit f91b1e7

Browse files
Fabio Estevambroonie
authored andcommitted
ASoC: soc-generic-dmaengine-pcm: Fix error handling
When dmaengine_pcm_request_chan_of() fails it should release the previously acquired resources, which in this case is to call kfree(pcm), so jump to the correct point in the error path. Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com> Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 4e36301 commit f91b1e7

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎sound/soc/soc-generic-dmaengine-pcm.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ int snd_dmaengine_pcm_register(struct device *dev,
450450

451451
ret = dmaengine_pcm_request_chan_of(pcm, dev, config);
452452
if (ret)
453-
goto err_free_dma;
453+
goto err_free_pcm;
454454

455455
ret = snd_soc_add_component(dev, &pcm->component,
456456
&dmaengine_pcm_component, NULL, 0);
@@ -461,6 +461,7 @@ int snd_dmaengine_pcm_register(struct device *dev,
461461

462462
err_free_dma:
463463
dmaengine_pcm_release_chan(pcm);
464+
err_free_pcm:
464465
kfree(pcm);
465466
return ret;
466467
}

0 commit comments

Comments
 (0)