From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
To: Navid Emamdoost <navid.emamdoost@gmail.com>
Cc: emamd001@umn.edu, kjlu@umn.edu, smccaman@umn.edu,
Liam Girdwood <lgirdwood@gmail.com>,
Mark Brown <broonie@kernel.org>, Jaroslav Kysela <perex@perex.cz>,
Takashi Iwai <tiwai@suse.com>,
Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>,
Ranjani Sridharan <ranjani.sridharan@linux.intel.com>,
Pan Xiuli <xiuli.pan@linux.intel.com>,
Kai Vehmanen <kai.vehmanen@linux.intel.com>,
Slawomir Blauciak <slawomir.blauciak@linux.intel.com>,
alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ASoC: SOF: ipc: Fix memory leak in sof_set_get_large_ctrl_data
Date: Sun, 27 Oct 2019 21:15:35 -0500 [thread overview]
Message-ID: <fb4fa7f3-fefb-e2d0-da4d-842396a7c251@linux.intel.com> (raw)
In-Reply-To: <20191027215330.12729-1-navid.emamdoost@gmail.com>
On 10/27/19 4:53 PM, Navid Emamdoost wrote:
> In the implementation of sof_set_get_large_ctrl_data() there is a memory
> leak in case an error. Release partdata if sof_get_ctrl_copy_params()
> fails.
>
> Fixes: 54d198d5019d ("ASoC: SOF: Propagate sof_get_ctrl_copy_params() error properly")
> Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
May I ask which tool you used to find those issues, looks like we have a
gap here?
> ---
> sound/soc/sof/ipc.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/sound/soc/sof/ipc.c b/sound/soc/sof/ipc.c
> index b2f359d2f7e5..086eeeab8679 100644
> --- a/sound/soc/sof/ipc.c
> +++ b/sound/soc/sof/ipc.c
> @@ -572,8 +572,10 @@ static int sof_set_get_large_ctrl_data(struct snd_sof_dev *sdev,
> else
> err = sof_get_ctrl_copy_params(cdata->type, partdata, cdata,
> sparams);
> - if (err < 0)
> + if (err < 0) {
> + kfree(partdata);
> return err;
> + }
>
> msg_bytes = sparams->msg_bytes;
> pl_size = sparams->pl_size;
>
next prev parent reply other threads:[~2019-10-28 2:15 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-27 21:53 [PATCH] ASoC: SOF: ipc: Fix memory leak in sof_set_get_large_ctrl_data Navid Emamdoost
2019-10-28 2:15 ` Pierre-Louis Bossart [this message]
2019-10-28 16:35 ` Navid Emamdoost
2019-10-28 14:56 ` Applied "ASoC: SOF: ipc: Fix memory leak in sof_set_get_large_ctrl_data" to the asoc tree Mark Brown
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=fb4fa7f3-fefb-e2d0-da4d-842396a7c251@linux.intel.com \
--to=pierre-louis.bossart@linux.intel.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=emamd001@umn.edu \
--cc=guennadi.liakhovetski@linux.intel.com \
--cc=kai.vehmanen@linux.intel.com \
--cc=kjlu@umn.edu \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=navid.emamdoost@gmail.com \
--cc=perex@perex.cz \
--cc=ranjani.sridharan@linux.intel.com \
--cc=slawomir.blauciak@linux.intel.com \
--cc=smccaman@umn.edu \
--cc=tiwai@suse.com \
--cc=xiuli.pan@linux.intel.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox