Skip to content

Commit

Permalink
ASoC: codecs: wcd934x: Add missing of_node_put() in wcd934x_codec_par…
Browse files Browse the repository at this point in the history
…se_data

[ Upstream commit 9531a63 ]

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 64b92de
("ASoC: wcd9335: fix a leaked reference by adding missing of_node_put")

Fixes: a61f3b4 ("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>
  • Loading branch information
Yuuoniy authored and gregkh committed Apr 8, 2022
1 parent c652f8f commit f8e89d8
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions sound/soc/codecs/wcd934x.c
Expand Up @@ -5886,6 +5886,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;
Expand Down

0 comments on commit f8e89d8

Please sign in to comment.