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

Commit 6599f780 authored by Kiran Gunda's avatar Kiran Gunda
Browse files

slim_ngd: Add NULL pointer check apart from error check



Check against NULL pointer after allocating
the memory for msm_slim_ctrl structure pointer
dynamically to avoid unexpected crashes.

Earlier this pointer is checked only for error
codes. In this patch NULL pointer check is also
added.

CRs-Fixed: 562417
Change-Id: I5cd731144f88b89ee412d19f110b3df6426186f7
Signed-off-by: default avatarKiran Gunda <kgunda@codeaurora.org>
parent 7182485d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1076,7 +1076,7 @@ static int ngd_slim_probe(struct platform_device *pdev)
	}

	dev = kzalloc(sizeof(struct msm_slim_ctrl), GFP_KERNEL);
	if (IS_ERR(dev)) {
	if (IS_ERR_OR_NULL(dev)) {
		dev_err(&pdev->dev, "no memory for MSM slimbus controller\n");
		return PTR_ERR(dev);
	}