ASoC: msmcobalt: fix wrong platform device pointer assignment

In machine driver probe, platform device pointer is assigned prior to
codec registration which might be invalid if wcd9335 and wcd934x sound
card registrations are going on simultaneously. Update the pointer after
sound card registration to avoid null pointer dereference.

CRs-Fixed: 1048402
Change-Id: I315e191227e14e207187673b8efb5401143dec9d
Signed-off-by: Vidyakumar Athota <vathota@codeaurora.org>
This commit is contained in:
Vidyakumar Athota 2016-08-08 20:42:54 -07:00 committed by Gerrit - the friendly Code Review server
parent e94b446eac
commit a9aa872509

View file

@ -3950,8 +3950,6 @@ static int msm_asoc_machine_probe(struct platform_device *pdev)
goto err;
}
spdev = pdev;
ret = msm_populate_dai_link_component_of_node(card);
if (ret) {
ret = -EPROBE_DEFER;
@ -3989,6 +3987,7 @@ static int msm_asoc_machine_probe(struct platform_device *pdev)
goto err;
}
dev_info(&pdev->dev, "Sound card %s registered\n", card->name);
spdev = pdev;
ret = of_property_read_string(pdev->dev.of_node,
"qcom,mbhc-audio-jack-type", &mbhc_audio_jack_type);