Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a9aa8725 authored by Vidyakumar Athota's avatar Vidyakumar Athota Committed by Gerrit - the friendly Code Review server
Browse files

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: default avatarVidyakumar Athota <vathota@codeaurora.org>
parent e94b446e
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -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);