mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-10 13:59:45 -04:00
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: cf536e2622 ("ASoC: mediatek: common: Handle mediatek,accdet property")
Cc: stable@vger.kernel.org # 6.15
Cc: Nícolas F. R. A. Prado <nfraprado@collabora.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Link: https://patch.msgid.link/20250722092542.32754-1-johan@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
@@ -262,9 +262,13 @@ int mtk_soundcard_common_probe(struct platform_device *pdev)
|
||||
soc_card_data->accdet = accdet_comp;
|
||||
else
|
||||
dev_err(&pdev->dev, "No sound component found from mediatek,accdet property\n");
|
||||
|
||||
put_device(&accdet_pdev->dev);
|
||||
} else {
|
||||
dev_err(&pdev->dev, "No device found from mediatek,accdet property\n");
|
||||
}
|
||||
|
||||
of_node_put(accdet_node);
|
||||
}
|
||||
|
||||
platform_node = of_parse_phandle(pdev->dev.of_node, "mediatek,platform", 0);
|
||||
|
||||
Reference in New Issue
Block a user