All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] ASoC: cros_ec_codec: Fix refcount leak in cros_ec_codec_platform_probe
@ 2022-06-03 13:10 Miaoqian Lin
  2022-06-03 16:44   ` Guenter Roeck
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Miaoqian Lin @ 2022-06-03 13:10 UTC (permalink / raw)
  To: Cheng-Yi Chiang, Tzung-Bi Shih, Guenter Roeck, Liam Girdwood,
	Mark Brown, Jaroslav Kysela, Takashi Iwai, Benson Leung,
	Enric Balletbo i Serra, chrome-platform, alsa-devel,
	linux-kernel
  Cc: linmq006

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@gmail.com>
---
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


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] ASoC: cros_ec_codec: Fix refcount leak in cros_ec_codec_platform_probe
  2022-06-03 13:10 [PATCH v2] ASoC: cros_ec_codec: Fix refcount leak in cros_ec_codec_platform_probe Miaoqian Lin
@ 2022-06-03 16:44   ` Guenter Roeck
  2022-06-06  3:24   ` Tzung-Bi Shih
  2022-06-07 10:45 ` Mark Brown
  2 siblings, 0 replies; 6+ messages in thread
From: Guenter Roeck @ 2022-06-03 16:44 UTC (permalink / raw)
  To: Miaoqian Lin
  Cc: Cheng-Yi Chiang, Tzung-Bi Shih, Guenter Roeck, Liam Girdwood,
	Mark Brown, Jaroslav Kysela, Takashi Iwai, Benson Leung,
	Enric Balletbo i Serra, chrome-platform, ALSA development,
	linux-kernel

On Fri, Jun 3, 2022 at 6:11 AM Miaoqian Lin <linmq006@gmail.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@gmail.com>

Reviewed-by: Guenter Roeck <groeck@chromium.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
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] ASoC: cros_ec_codec: Fix refcount leak in cros_ec_codec_platform_probe
@ 2022-06-03 16:44   ` Guenter Roeck
  0 siblings, 0 replies; 6+ messages in thread
From: Guenter Roeck @ 2022-06-03 16:44 UTC (permalink / raw)
  To: Miaoqian Lin
  Cc: Enric Balletbo i Serra, ALSA development, chrome-platform,
	linux-kernel, Takashi Iwai, Liam Girdwood, Tzung-Bi Shih,
	Mark Brown, Guenter Roeck, Benson Leung, Cheng-Yi Chiang

On Fri, Jun 3, 2022 at 6:11 AM Miaoqian Lin <linmq006@gmail.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@gmail.com>

Reviewed-by: Guenter Roeck <groeck@chromium.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
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] ASoC: cros_ec_codec: Fix refcount leak in cros_ec_codec_platform_probe
  2022-06-03 13:10 [PATCH v2] ASoC: cros_ec_codec: Fix refcount leak in cros_ec_codec_platform_probe Miaoqian Lin
@ 2022-06-06  3:24   ` Tzung-Bi Shih
  2022-06-06  3:24   ` Tzung-Bi Shih
  2022-06-07 10:45 ` Mark Brown
  2 siblings, 0 replies; 6+ messages in thread
From: Tzung-Bi Shih @ 2022-06-06  3:24 UTC (permalink / raw)
  To: Miaoqian Lin
  Cc: Cheng-Yi Chiang, Guenter Roeck, Liam Girdwood, Mark Brown,
	Jaroslav Kysela, Takashi Iwai, Benson Leung,
	Enric Balletbo i Serra, chrome-platform, alsa-devel,
	linux-kernel

On Fri, Jun 03, 2022 at 05:10:43PM +0400, Miaoqian Lin 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@gmail.com>

Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] ASoC: cros_ec_codec: Fix refcount leak in cros_ec_codec_platform_probe
@ 2022-06-06  3:24   ` Tzung-Bi Shih
  0 siblings, 0 replies; 6+ messages in thread
From: Tzung-Bi Shih @ 2022-06-06  3:24 UTC (permalink / raw)
  To: Miaoqian Lin
  Cc: chrome-platform, alsa-devel, Liam Girdwood, linux-kernel,
	Takashi Iwai, Enric Balletbo i Serra, Mark Brown, Guenter Roeck,
	Benson Leung, Cheng-Yi Chiang

On Fri, Jun 03, 2022 at 05:10:43PM +0400, Miaoqian Lin 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@gmail.com>

Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] ASoC: cros_ec_codec: Fix refcount leak in cros_ec_codec_platform_probe
  2022-06-03 13:10 [PATCH v2] ASoC: cros_ec_codec: Fix refcount leak in cros_ec_codec_platform_probe Miaoqian Lin
  2022-06-03 16:44   ` Guenter Roeck
  2022-06-06  3:24   ` Tzung-Bi Shih
@ 2022-06-07 10:45 ` Mark Brown
  2 siblings, 0 replies; 6+ messages in thread
From: Mark Brown @ 2022-06-07 10:45 UTC (permalink / raw)
  To: cychiang, chrome-platform, linmq006, Liam Girdwood, tzungbi,
	Takashi Iwai, groeck, enric.balletbo, linux-kernel, bleung,
	Jaroslav Kysela, alsa-devel

On Fri, 3 Jun 2022 17:10:43 +0400, Miaoqian Lin 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.
> 
> 

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/1] ASoC: cros_ec_codec: Fix refcount leak in cros_ec_codec_platform_probe
      commit: 0a034d93ee929a9ea89f3fa5f1d8492435b9ee6e

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-06-07 10:45 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-03 13:10 [PATCH v2] ASoC: cros_ec_codec: Fix refcount leak in cros_ec_codec_platform_probe Miaoqian Lin
2022-06-03 16:44 ` Guenter Roeck
2022-06-03 16:44   ` Guenter Roeck
2022-06-06  3:24 ` Tzung-Bi Shih
2022-06-06  3:24   ` Tzung-Bi Shih
2022-06-07 10:45 ` Mark Brown

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.