]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ASoC: qcom: common: Fix refcount imbalance on error
authorDinghao Liu <dinghao.liu@zju.edu.cn>
Thu, 20 Aug 2020 04:28:27 +0000 (12:28 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 23 Sep 2020 10:59:53 +0000 (12:59 +0200)
commiteb6acd695420e6845a6ccd079f98a8dd91a9e7c4
treeab0df22ec43cc93076b9d18056b2ff1790a79f7b
parent3ae4251f2035b878ac023356719eb5fc75972ca2
ASoC: qcom: common: Fix refcount imbalance on error

[ Upstream commit c1e6414cdc371f9ed82cefebba7538499a3059f9 ]

for_each_child_of_node returns a node pointer np with
refcount incremented. So when devm_kzalloc fails, a
pairing refcount decrement is needed to keep np's
refcount balanced.

Fixes: 16395ceee11f8 ("ASoC: qcom: common: Fix NULL pointer in of parser")
Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
Link: https://lore.kernel.org/r/20200820042828.10308-1-dinghao.liu@zju.edu.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
sound/soc/qcom/common.c