ath10k: Fix error handling in ath10k_setup_msa_resources
authorMiaoqian Lin <linmq006@gmail.com>
Tue, 8 Mar 2022 07:02:38 +0000 (07:02 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 8 Apr 2022 12:23:39 +0000 (14:23 +0200)
commit32939187f254171a5666badc058bc3787fe454af
treeb41e4d68c3d3dc1e66b6c1156a52163ac0cbb5f4
parent9d04f4a15fe0ccdb1fc998b39036795b8dbcc88a
ath10k: Fix error handling in ath10k_setup_msa_resources

[ Upstream commit 9747a78d5f758a5284751a10aee13c30d02bd5f1 ]

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 path.

Fixes: 727fec790ead ("ath10k: Setup the msa resources before qmi init")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Reviewed-by: Jeff Johnson <quic_jjohnson@quicinc.com>
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
Link: https://lore.kernel.org/r/20220308070238.19295-1-linmq006@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/wireless/ath/ath10k/snoc.c