提交 fdc136cc 编写于 作者: D Dave Jones 提交者: Len Brown

[ACPI] fix possible acpi thermal leak in failure path

Coverity: #601
Signed-off-by: NDave Jones <davej@redhat.com>
Signed-off-by: NLen Brown <len.brown@intel.com>
上级 a1f9e65e
......@@ -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"));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册