[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CABXOdTdZNBM=RA_72bL8nua=qajRWD3iKEDi3bai+Aghu1ygJQ@mail.gmail.com>
Date: Fri, 3 Jun 2022 09:44:15 -0700
From: Guenter Roeck <groeck@...gle.com>
To: Miaoqian Lin <linmq006@...il.com>
Cc: Cheng-Yi Chiang <cychiang@...omium.org>,
Tzung-Bi Shih <tzungbi@...gle.com>,
Guenter Roeck <groeck@...omium.org>,
Liam Girdwood <lgirdwood@...il.com>,
Mark Brown <broonie@...nel.org>,
Jaroslav Kysela <perex@...ex.cz>,
Takashi Iwai <tiwai@...e.com>,
Benson Leung <bleung@...omium.org>,
Enric Balletbo i Serra <enric.balletbo@...labora.com>,
chrome-platform@...ts.linux.dev,
ALSA development <alsa-devel@...a-project.org>,
linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2] ASoC: cros_ec_codec: Fix refcount leak in cros_ec_codec_platform_probe
On Fri, Jun 3, 2022 at 6:11 AM Miaoqian Lin <linmq006@...il.com> wrote:
>
> of_parse_phandle() returns a node pointer with refcount
> incremented, we should use of_node_put() on it when not need anymore.
> Add missing of_node_put() to avoid refcount leak.
>
> Fixes: b6bc07d4360d ("ASoC: cros_ec_codec: support WoV")
> Signed-off-by: Miaoqian Lin <linmq006@...il.com>
Reviewed-by: Guenter Roeck <groeck@...omium.org>
> ---
> changes in v2:
> - update Fixes tag
> v1 Link: https://lore.kernel.org/r/20220602114529.6303-1-linmq006@gmail.com
> ---
> sound/soc/codecs/cros_ec_codec.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/sound/soc/codecs/cros_ec_codec.c b/sound/soc/codecs/cros_ec_codec.c
> index 8b0a9c788a26..11e7b3f6d410 100644
> --- a/sound/soc/codecs/cros_ec_codec.c
> +++ b/sound/soc/codecs/cros_ec_codec.c
> @@ -995,6 +995,7 @@ static int cros_ec_codec_platform_probe(struct platform_device *pdev)
> dev_dbg(dev, "ap_shm_phys_addr=%#llx len=%#x\n",
> priv->ap_shm_phys_addr, priv->ap_shm_len);
> }
> + of_node_put(node);
> }
> #endif
>
> --
> 2.25.1
>
Powered by blists - more mailing lists