Skip to content

Commit 696e123

Browse files
jhovoldbroonie
authored andcommitted
ASoC: mediatek: common: fix device and OF node leak
Make sure to drop the references to the accdet OF node and platform device taken by of_parse_phandle() and of_find_device_by_node() after looking up the sound component during probe. Fixes: cf536e2 ("ASoC: mediatek: common: Handle mediatek,accdet property") Cc: [email protected] # 6.15 Cc: Nícolas F. R. A. Prado <[email protected]> Signed-off-by: Johan Hovold <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 9e55f11 commit 696e123

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

sound/soc/mediatek/common/mtk-soundcard-driver.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,9 +262,13 @@ int mtk_soundcard_common_probe(struct platform_device *pdev)
262262
soc_card_data->accdet = accdet_comp;
263263
else
264264
dev_err(&pdev->dev, "No sound component found from mediatek,accdet property\n");
265+
266+
put_device(&accdet_pdev->dev);
265267
} else {
266268
dev_err(&pdev->dev, "No device found from mediatek,accdet property\n");
267269
}
270+
271+
of_node_put(accdet_node);
268272
}
269273

270274
platform_node = of_parse_phandle(pdev->dev.of_node, "mediatek,platform", 0);

0 commit comments

Comments
 (0)