]> git.baikalelectronics.ru Git - kernel.git/commit
ASoC: atmel: Fix error handling in snd_proto_probe
authorMiaoqian Lin <linmq006@gmail.com>
Tue, 8 Mar 2022 01:39:48 +0000 (01:39 +0000)
committerMark Brown <broonie@kernel.org>
Tue, 8 Mar 2022 12:27:51 +0000 (12:27 +0000)
commit45c74c207aaa6122c45a6fd73bcf257b42b0e90f
tree9cafb399e9a554d60168b2b0df6c76c6af04308a
parent56e6515a65aeab23b512de34d6e182c0f7522c80
ASoC: atmel: Fix error handling in snd_proto_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.

Fixes: 6da93025eaa4 ("ASoC: Add driver for PROTO Audio CODEC (with a WM8731)")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Reviewed-by: Codrin Ciubotariu <codrin.ciubotariu@microchip.com>
Link: https://lore.kernel.org/r/20220308013949.20323-1-linmq006@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/atmel/mikroe-proto.c