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

Commit edf09883 authored by Phani Kumar Uppalapati's avatar Phani Kumar Uppalapati Committed by Gerrit - the friendly Code Review server
Browse files

ASoC: wcd9330: Avoid NULL pointer access



It is possible that codec private data will
be accessed without creating memory when
sound card is not registered. Avoid kernel
crash by checking it for NULL and return without
access.

CRs-Fixed: 657811
Change-Id: I4d8636252d2b75aa964eaf0c1b3d44e3f0976771
Signed-off-by: default avatarPhani Kumar Uppalapati <phaniu@codeaurora.org>
parent 32e5112c
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -7328,6 +7328,11 @@ static int tomtom_resume(struct device *dev)
{
	struct platform_device *pdev = to_platform_device(dev);
	struct tomtom_priv *tomtom = platform_get_drvdata(pdev);

	if (!tomtom) {
		dev_err(dev, "%s: tomtom private data is NULL\n", __func__);
		return -EINVAL;
	}
	dev_dbg(dev, "%s: system resume\n", __func__);
	/* Notify */
	wcd9xxx_resmgr_notifier_call(&tomtom->resmgr,