]> git.baikalelectronics.ru Git - kernel.git/commit
ASoC: mediatek: Fix error handling in mt8183_da7219_max98357_dev_probe
authorMiaoqian Lin <linmq006@gmail.com>
Wed, 16 Mar 2022 01:40:57 +0000 (01:40 +0000)
committerMark Brown <broonie@kernel.org>
Wed, 16 Mar 2022 16:39:20 +0000 (16:39 +0000)
commit84b8aa240486ab13f3484e6c83d78ffc5753b326
tree2d8ebe9a4689c90978b75606d92a452268149f7e
parentdc033415302fb10c53c0abfcab67f5a18842de18
ASoC: mediatek: Fix error handling in mt8183_da7219_max98357_dev_probe

The device_node pointer is returned by of_parse_phandle()  with refcount
incremented. We should use of_node_put() on it when done.

This function only calls of_node_put() in the regular path.
And it will cause refcount leak in error paths.
Fix this by calling of_node_put() in error handling too.

Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org>
Link: https://lore.kernel.org/r/20220316014059.19292-1-linmq006@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/mediatek/mt8183/mt8183-da7219-max98357.c