Skip to content
Unverified Commit 4e59dd24 authored by Dan Carpenter's avatar Dan Carpenter Committed by Mark Brown
Browse files

ASoC: qcom: common: Fix refcounting in qcom_snd_parse_of()



There are two issues in this function.

1) We can't drop the refrences on "cpu", "codec" and "platform" before
   we take the reference.  This doesn't cause a problem on the first
   iteration because those pointers start as NULL so the of_node_put()
   is a no-op.  But on the subsequent iterations, it will lead to a use
   after free.

2) If the devm_kzalloc() allocation failed then the code returned
   directly instead of cleaning up.

Fixes: c1e6414c ("ASoC: qcom: common: Fix refcount imbalance on error")
Fixes: 1e36ea36 ("ASoC: qcom: common: use modern dai_link style")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/20201105125154.GA176426@mwanda


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 048751de
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment