]> git.baikalelectronics.ru Git - kernel.git/commit
ASoC: qcom: common: Fix NULL pointer in of parser
authorBjorn Andersson <bjorn.andersson@linaro.org>
Tue, 18 Jun 2019 05:28:13 +0000 (22:28 -0700)
committerMark Brown <broonie@kernel.org>
Wed, 19 Jun 2019 11:04:24 +0000 (12:04 +0100)
commitfcd6e9e449ad00f67a8edb744a80c754c5eb6de3
treef0b0ff2ec3d4a8e9a1e3965d5fd12e5564356dcd
parent5ab23cbfe434e8b1c6418510deb487e2a6542295
ASoC: qcom: common: Fix NULL pointer in of parser

A snd_soc_dai_link_component is allocated and associated with the first
link, so when the code tries to assign the of_node of the second link's
"cpu" member it dereferences a NULL pointer.

Fix this by moving the allocation and assignement of
snd_soc_dai_link_components into the loop, giving us one pair per link.

Fixes: e16fba78b33a ("ASoC: qcom: common: use modern dai_link style")
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Acked-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/qcom/common.c