From: Fabio Estevam <festevam@gmail.com>
To: broonie@kernel.org
Cc: Fabio Estevam <fabio.estevam@nxp.com>,
alsa-devel@alsa-project.org, lars@metafoo.de
Subject: [PATCH 1/2] ASoC: soc-generic-dmaengine-pcm: Fix error handling
Date: Thu, 22 Feb 2018 16:02:21 -0300 [thread overview]
Message-ID: <1519326142-26421-1-git-send-email-festevam@gmail.com> (raw)
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
next reply other threads:[~2018-02-22 19:02 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-22 19:02 Fabio Estevam [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1519326142-26421-1-git-send-email-festevam@gmail.com \
--to=festevam@gmail.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=fabio.estevam@nxp.com \
--cc=lars@metafoo.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.