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

Commit 990ec812 authored by Vatsal Bucha's avatar Vatsal Bucha
Browse files

ASoC: Fix NULL pointer dereference in digital suspend



If soundcard registration has failed because of custom
driver probe failure and at the same time
msm_dig_suspend is called, this will lead to
null pointer dereference when component is accessed.
Add NULL check to avoid this.

CRs-Fixed: 2263005
Change-Id: If04ec624e45f05ebe08ee6500ccb13e3c8287051
Signed-off-by: default avatarVatsal Bucha <vbucha@codeaurora.org>
parent 73c9a214
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -2563,6 +2563,10 @@ static int msm_dig_suspend(struct device *dev)
		pr_debug("%s:digcodec not initialized, return\n", __func__);
		return 0;
	}
	if (!registered_digcodec->component.card) {
		pr_debug("%s:component not initialized, return\n", __func__);
		return 0;
	}
	pdata = snd_soc_card_get_drvdata(registered_digcodec->component.card);
	if (!pdata) {
		pr_debug("%s:card not initialized, return\n", __func__);