All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] ASoC: soc-generic-dmaengine-pcm: Fix error handling
@ 2018-02-22 19:02 Fabio Estevam
  2018-02-22 19:02 ` [PATCH 2/2] ASoC: soc-generic-dmaengine-pcm: Fix sparse warnings Fabio Estevam
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Fabio Estevam @ 2018-02-22 19:02 UTC (permalink / raw)
  To: broonie; +Cc: Fabio Estevam, alsa-devel, lars

From: Fabio Estevam <fabio.estevam@nxp.com>

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>
---
 sound/soc/soc-generic-dmaengine-pcm.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/sound/soc/soc-generic-dmaengine-pcm.c b/sound/soc/soc-generic-dmaengine-pcm.c
index 768247f..32ea16d 100644
--- a/sound/soc/soc-generic-dmaengine-pcm.c
+++ b/sound/soc/soc-generic-dmaengine-pcm.c
@@ -450,7 +450,7 @@ int snd_dmaengine_pcm_register(struct device *dev,
 
 	ret = dmaengine_pcm_request_chan_of(pcm, dev, config);
 	if (ret)
-		goto err_free_dma;
+		goto err_free_pcm;
 
 	ret = snd_soc_add_component(dev, &pcm->component,
 				    &dmaengine_pcm_component, NULL, 0);
@@ -461,6 +461,7 @@ int snd_dmaengine_pcm_register(struct device *dev,
 
 err_free_dma:
 	dmaengine_pcm_release_chan(pcm);
+err_free_pcm:
 	kfree(pcm);
 	return ret;
 }
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-02-26 14:35 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-22 19:02 [PATCH 1/2] ASoC: soc-generic-dmaengine-pcm: Fix error handling Fabio Estevam
2018-02-22 19:02 ` [PATCH 2/2] ASoC: soc-generic-dmaengine-pcm: Fix sparse warnings Fabio Estevam
2018-02-26 11:17   ` Applied "ASoC: soc-generic-dmaengine-pcm: Fix sparse warnings" to the asoc tree Mark Brown
2018-02-26 11:17 ` Applied "ASoC: soc-generic-dmaengine-pcm: Fix error handling" " Mark Brown
2018-02-26 14:25 ` [PATCH 1/2] ASoC: soc-generic-dmaengine-pcm: Fix error handling Lars-Peter Clausen
2018-02-26 14:35   ` Fabio Estevam

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.