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

Commit fdc136cc authored by Dave Jones's avatar Dave Jones Committed by Len Brown
Browse files

[ACPI] fix possible acpi thermal leak in failure path



Coverity: #601

Signed-off-by: default avatarDave Jones <davej@redhat.com>
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent a1f9e65e
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -942,8 +942,10 @@ acpi_thermal_write_trip_points(struct file *file,
	memset(limit_string, 0, ACPI_THERMAL_MAX_LIMIT_STR_LEN);

	active = kmalloc(ACPI_THERMAL_MAX_ACTIVE * sizeof(int), GFP_KERNEL);
	if (!active)
	if (!active) {
		kfree(limit_string);
		return_VALUE(-ENOMEM);
	}

	if (!tz || (count > ACPI_THERMAL_MAX_LIMIT_STR_LEN - 1)) {
		ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid argument\n"));