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

Commit 60e8e8b7 authored by Jayaprakash's avatar Jayaprakash
Browse files

disp: msm: free the memory in failure cases in notifier probe



Free the allocated memory in cases of probe failure in
msm notifier driver.

Change-Id: Ibaa9a6184008a3c516232a921429c64bcbdd5ef9
Signed-off-by: default avatarJayaprakash <jmadiset@codeaurora.org>
parent 7f7cf760
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -129,8 +129,10 @@ static int msm_notifier_probe(struct platform_device *pdev)

	active_displays = devm_kzalloc(&pdev->dev,
				sizeof(*active_displays), GFP_KERNEL);
	if (!active_displays)
		return -ENOMEM;
	if (!active_displays) {
		ret = -ENOMEM;
		goto end;
	}

	INIT_LIST_HEAD(&active_displays->list);

@@ -174,6 +176,9 @@ static int msm_notifier_probe(struct platform_device *pdev)
	list_for_each_entry(display, &active_displays->list, list)
		drm_panel_notifier_unregister(display->panel, &info->notifier);

	devm_kfree(&pdev->dev, active_displays);
end:
	devm_kfree(&pdev->dev, info);
	return ret;
}