From: Yang Yingliang <yangyingliang@huawei.com>
To: <alsa-devel@alsa-project.org>
Cc: Takashi Iwai <tiwai@suse.de>,
yangyingliang@huawei.com, cezary.rojewski@intel.com,
broonie@kernel.org, amadeuszx.slawinski@linux.intel.com
Subject: Re: [PATCH] ASoC: Intel: avs: fix possible memory leak in probe_codec()
Date: Wed, 2 Nov 2022 09:48:30 +0800 [thread overview]
Message-ID: <9c364bc3-582d-c4ff-9aaf-deeddc30e57b@huawei.com> (raw)
In-Reply-To: <20221022025804.1221953-1-yangyingliang@huawei.com>
+Cc: Takashi Iwai <tiwai@suse.de>
Hi, is this patch good?
Thanks,
Yang
On 2022/10/22 10:58, Yang Yingliang wrote:
> If snd_hda_codec_configure() fails, 'codec' and name allocated in
> dev_set_name() called in snd_hdac_device_init() are leaked. Fix this
> by calling snd_hdac_device_unregister() and put_device(), so they
> can be freed in snd_hda_codec_dev_release() and kobject_cleanup().
>
> Fixes: 1affc44ea5dd ("ASoC: Intel: avs: PCI driver implementation")
> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
> ---
> sound/soc/intel/avs/core.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/sound/soc/intel/avs/core.c b/sound/soc/intel/avs/core.c
> index bb0719c58ca4..2fde2b3f8790 100644
> --- a/sound/soc/intel/avs/core.c
> +++ b/sound/soc/intel/avs/core.c
> @@ -140,6 +140,8 @@ static int probe_codec(struct hdac_bus *bus, int addr)
> ret = snd_hda_codec_configure(codec);
> if (ret < 0) {
> dev_err(bus->dev, "failed to config codec %d\n", ret);
> + snd_hdac_device_unregister(&codec->core);
> + put_device(&codec->core.dev);
> return ret;
> }
>
next prev parent reply other threads:[~2022-11-02 1:49 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-22 2:58 [PATCH] ASoC: Intel: avs: fix possible memory leak in probe_codec() Yang Yingliang
2022-11-02 1:48 ` Yang Yingliang [this message]
2022-11-02 6:36 ` Takashi Iwai
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=9c364bc3-582d-c4ff-9aaf-deeddc30e57b@huawei.com \
--to=yangyingliang@huawei.com \
--cc=alsa-devel@alsa-project.org \
--cc=amadeuszx.slawinski@linux.intel.com \
--cc=broonie@kernel.org \
--cc=cezary.rojewski@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