]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
ASoC: codecs: wcd934x: Add missing of_node_put() in wcd934x_codec_parse_data
authorMiaoqian Lin <linmq006@gmail.com>
Wed, 16 Mar 2022 08:36:31 +0000 (08:36 +0000)
committerStefan Bader <stefan.bader@canonical.com>
Wed, 27 Apr 2022 09:57:23 +0000 (11:57 +0200)
BugLink: https://bugs.launchpad.net/bugs/1969110
[ Upstream commit 9531a631379169d57756b2411178c6238655df88 ]

The device_node pointer is returned by of_parse_phandle()  with refcount
incremented. We should use of_node_put() on it when done.
This is similar to commit 64b92de9603f
("ASoC: wcd9335: fix a leaked reference by adding missing of_node_put")

Fixes: a61f3b4f476e ("ASoC: wcd934x: add support to wcd9340/wcd9341 codec")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Link: https://lore.kernel.org/r/20220316083631.14103-1-linmq006@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
(cherry picked from commit 2f44eca78cc6d4e1779eb95765ec79e433accab4)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
sound/soc/codecs/wcd934x.c

index 654d847a050e6f10f4e0ea5fa34506ae3aabc7d7..7b99318070cfa6cd1ddf65416f7eb5dd54e7ee1e 100644 (file)
@@ -5888,6 +5888,7 @@ static int wcd934x_codec_parse_data(struct wcd934x_codec *wcd)
        }
 
        wcd->sidev = of_slim_get_device(wcd->sdev->ctrl, ifc_dev_np);
+       of_node_put(ifc_dev_np);
        if (!wcd->sidev) {
                dev_err(dev, "Unable to get SLIM Interface device\n");
                return -EINVAL;