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

Commit 2db1fabe authored by Aravind Kumar's avatar Aravind Kumar
Browse files

ASoC: msm8226: Avoid possible NULL pointer dereference



If memory allocation fails returning a NULL pointer,
the current code will skip to an error handling section
where the NULL pointer will get dereferenced. The
change skips the error handling and exits immediately
from the function.

CRs-Fixed: 628857
Change-Id: Ic14377ec387eeb7f227f1f0abffb64737b0a2654
Signed-off-by: default avatarAravind Kumar <akumark@codeaurora.org>
parent 74aaf7ba
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -2274,8 +2274,7 @@ static int msm8226_asoc_machine_probe(struct platform_device *pdev)
			sizeof(struct msm8226_asoc_mach_data), GFP_KERNEL);
	if (!pdata) {
		dev_err(&pdev->dev, "Can't allocate msm8226_asoc_mach_data\n");
		ret = -ENOMEM;
		goto err;
		return -ENOMEM;
	}

	card = populate_snd_card_dailinks(&pdev->dev);