Commit 7acc8a2a authored by Rafael J. Wysocki's avatar Rafael J. Wysocki

Merge back earlier int340x driver changes for 5.19.

parents 7b145802 be60348a
...@@ -169,28 +169,25 @@ static int int3400_thermal_run_osc(acpi_handle handle, char *uuid_str, int *enab ...@@ -169,28 +169,25 @@ static int int3400_thermal_run_osc(acpi_handle handle, char *uuid_str, int *enab
acpi_status status; acpi_status status;
int result = 0; int result = 0;
struct acpi_osc_context context = { struct acpi_osc_context context = {
.uuid_str = NULL, .uuid_str = uuid_str,
.rev = 1, .rev = 1,
.cap.length = 8, .cap.length = 8,
.cap.pointer = buf,
}; };
context.uuid_str = uuid_str;
buf[OSC_QUERY_DWORD] = 0; buf[OSC_QUERY_DWORD] = 0;
buf[OSC_SUPPORT_DWORD] = *enable; buf[OSC_SUPPORT_DWORD] = *enable;
context.cap.pointer = buf;
status = acpi_run_osc(handle, &context); status = acpi_run_osc(handle, &context);
if (ACPI_SUCCESS(status)) { if (ACPI_SUCCESS(status)) {
ret = *((u32 *)(context.ret.pointer + 4)); ret = *((u32 *)(context.ret.pointer + 4));
if (ret != *enable) if (ret != *enable)
result = -EPERM; result = -EPERM;
kfree(context.ret.pointer);
} else } else
result = -EPERM; result = -EPERM;
kfree(context.ret.pointer);
return result; return result;
} }
...@@ -524,21 +521,18 @@ static void int3400_setup_gddv(struct int3400_thermal_priv *priv) ...@@ -524,21 +521,18 @@ static void int3400_setup_gddv(struct int3400_thermal_priv *priv)
obj = buffer.pointer; obj = buffer.pointer;
if (obj->type != ACPI_TYPE_PACKAGE || obj->package.count != 1 if (obj->type != ACPI_TYPE_PACKAGE || obj->package.count != 1
|| obj->package.elements[0].type != ACPI_TYPE_BUFFER) { || obj->package.elements[0].type != ACPI_TYPE_BUFFER)
kfree(buffer.pointer); goto out_free;
return;
}
priv->data_vault = kmemdup(obj->package.elements[0].buffer.pointer, priv->data_vault = kmemdup(obj->package.elements[0].buffer.pointer,
obj->package.elements[0].buffer.length, obj->package.elements[0].buffer.length,
GFP_KERNEL); GFP_KERNEL);
if (!priv->data_vault) { if (!priv->data_vault)
kfree(buffer.pointer); goto out_free;
return;
}
bin_attr_data_vault.private = priv->data_vault; bin_attr_data_vault.private = priv->data_vault;
bin_attr_data_vault.size = obj->package.elements[0].buffer.length; bin_attr_data_vault.size = obj->package.elements[0].buffer.length;
out_free:
kfree(buffer.pointer); kfree(buffer.pointer);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment