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

Commit 17f9b896 authored by Konrad Rzeszutek Wilk's avatar Konrad Rzeszutek Wilk
Browse files

xen/acpi: Fix potential memory leak.



Coverity points out that we do not free in one case the
pr_backup - and sure enough we forgot.

Found by Coverity (CID 401970)

Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
parent a867e5d6
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -520,15 +520,18 @@ static int __init xen_acpi_processor_init(void)

		if (!pr_backup) {
			pr_backup = kzalloc(sizeof(struct acpi_processor), GFP_KERNEL);
			if (pr_backup)
				memcpy(pr_backup, _pr, sizeof(struct acpi_processor));
		}
		(void)upload_pm_data(_pr);
	}
	rc = check_acpi_ids(pr_backup);
	if (rc)
		goto err_unregister;

	kfree(pr_backup);
	pr_backup = NULL;

	if (rc)
		goto err_unregister;

	return 0;
err_unregister: