]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 8 Apr 2022 11:57:52 +0000 (13:57 +0200)
commit8fa969cd8485031294f91fc7184399000cae6355
treea923390b19939a844a1562458c747d0252355919
parentdac04e6911785bb09c9decf5c1f8dce5930dfdbf
ASoC: atmel: Fix error handling in snd_proto_probe

[ Upstream commit b0bfaf0544d08d093d6211d7ef8816fb0b5b6c75 ]

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: a45f8853a5f9 ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
sound/soc/atmel/mikroe-proto.c