Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Fabio Estevam and committed by
Mark Brown
f91b1e73 4e363010

+2 -1
+2 -1
sound/soc/soc-generic-dmaengine-pcm.c
··· 450 450 451 451 ret = dmaengine_pcm_request_chan_of(pcm, dev, config); 452 452 if (ret) 453 - goto err_free_dma; 453 + goto err_free_pcm; 454 454 455 455 ret = snd_soc_add_component(dev, &pcm->component, 456 456 &dmaengine_pcm_component, NULL, 0); ··· 461 461 462 462 err_free_dma: 463 463 dmaengine_pcm_release_chan(pcm); 464 + err_free_pcm: 464 465 kfree(pcm); 465 466 return ret; 466 467 }