From: Vinod Koul <vinod.koul@intel.com>
To: Guneshwor Singh <guneshwor.o.singh@intel.com>
Cc: ALSA ML <alsa-devel@alsa-project.org>,
Takashi Iwai <tiwai@suse.de>,
Liam Girdwood <liam.r.girdwood@linux.intel.com>,
Patches Audio <patches.audio@intel.com>,
Mark Brown <broonie@kernel.org>,
"Subhransu S. Prusty" <subhransu.s.prusty@intel.com>
Subject: Re: [PATCH] ALSA: hda - Fix memory leak on snd_hdac_device_init error
Date: Thu, 9 Nov 2017 10:14:19 +0530 [thread overview]
Message-ID: <20171109044419.GD3187@localhost> (raw)
In-Reply-To: <20171109032751.20573-1-guneshwor.o.singh@intel.com>
On Thu, Nov 09, 2017 at 08:57:51AM +0530, Guneshwor Singh wrote:
> From: "Subhransu S. Prusty" <subhransu.s.prusty@intel.com>
>
> Free codec vendor name on snd_hdac_device_init error.
>
> Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
> Signed-off-by: Guneshwor Singh <guneshwor.o.singh@intel.com>
> ---
> sound/hda/hdac_device.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/sound/hda/hdac_device.c b/sound/hda/hdac_device.c
> index 19deb306facb..467b949544e2 100644
> --- a/sound/hda/hdac_device.c
> +++ b/sound/hda/hdac_device.c
> @@ -111,6 +111,8 @@ int snd_hdac_device_init(struct hdac_device *codec, struct hdac_bus *bus,
> return 0;
>
> error:
> + kfree(codec->vendor_name);
Sorry I dont think this is right.
The vendor name is freed in the snd_hdac_device_exit()
We drop the reference here and release method would be called to
free up the resources.
> put_device(&codec->dev);
> return err;
> }
> --
> 2.15.0
>
--
~Vinod
next prev parent reply other threads:[~2017-11-09 4:41 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-09 3:27 [PATCH] ALSA: hda - Fix memory leak on snd_hdac_device_init error Guneshwor Singh
2017-11-09 4:44 ` Vinod Koul [this message]
2017-11-09 7:31 ` Takashi Iwai
2017-11-09 11:29 ` Singh, Guneshwor
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=20171109044419.GD3187@localhost \
--to=vinod.koul@intel.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=guneshwor.o.singh@intel.com \
--cc=liam.r.girdwood@linux.intel.com \
--cc=patches.audio@intel.com \
--cc=subhransu.s.prusty@intel.com \
--cc=tiwai@suse.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).