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

Commit 3847d223 authored by Daniel J Blueman's avatar Daniel J Blueman Committed by Dave Jones
Browse files

[CPUFREQ] fix double freeing in error path of pcc-cpufreq



Prevent double freeing on error path.

Signed-off-by: default avatarDaniel J Blueman <daniel.blueman@gmail.com>
Signed-off-by: default avatarDave Jones <davej@redhat.com>
parent 47f8bcf3
Loading
Loading
Loading
Loading
+6 −12
Original line number Diff line number Diff line
@@ -368,22 +368,16 @@ static int __init pcc_cpufreq_do_osc(acpi_handle *handle)
		return -ENODEV;

	out_obj = output.pointer;
	if (out_obj->type != ACPI_TYPE_BUFFER) {
		ret = -ENODEV;
		goto out_free;
	}
	if (out_obj->type != ACPI_TYPE_BUFFER)
		return -ENODEV;

	errors = *((u32 *)out_obj->buffer.pointer) & ~(1 << 0);
	if (errors) {
		ret = -ENODEV;
		goto out_free;
	}
	if (errors)
		return -ENODEV;

	supported = *((u32 *)(out_obj->buffer.pointer + 4));
	if (!(supported & 0x1)) {
		ret = -ENODEV;
		goto out_free;
	}
	if (!(supported & 0x1))
		return -ENODEV;

out_free:
	kfree(output.pointer);