ASoC: cros_ec_codec: Fix refcount leak in cros_ec_codec_platform_probe
authorMiaoqian Lin <linmq006@gmail.com>
Fri, 3 Jun 2022 13:10:43 +0000 (17:10 +0400)
committerMark Brown <broonie@kernel.org>
Mon, 6 Jun 2022 11:38:26 +0000 (12:38 +0100)
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>
Reviewed-by: Guenter Roeck <groeck@chromium.org>
Link: https://lore.kernel.org/r/20220603131043.38907-1-linmq006@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/cros_ec_codec.c

index 8b0a9c788a264b14eddada9c00ec4e7e11479ddc..11e7b3f6d410bb47f31eb0c2110cd7f08d39d46c 100644 (file)
@@ -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