Re: [PATCH] ASoC: qcom: common: Fix NULL pointer in of parser

From: Srinivas Kandagatla
Date: Tue Jun 18 2019 - 04:18:03 EST


Thanks Bjorn for this patch.

On 18/06/2019 06:28, Bjorn Andersson wrote:
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: 1e36ea360ab9 ("ASoC: qcom: common: use modern dai_link style")
Signed-off-by: Bjorn Andersson <bjorn.andersson@xxxxxxxxxx>

I think the original patch did not realize that there are multiple links!

Acked-by: Srinivas Kandagatla <srinivas.kandagatla@xxxxxxxxxx>