summaryrefslogtreecommitdiffstats
path: root/drivers/acpi/bus.c
diff options
context:
space:
mode:
authorAndrei Epure <epure.andrei@gmail.com>2013-03-11 08:20:16 +0000
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-03-24 23:31:33 +0100
commite2cb5f08469c991b187f66fa627d7673c7f3361b (patch)
tree0b31ae4416e8c1f0a3dc40e35a6469566ce438fa /drivers/acpi/bus.c
parent82160dd8ba4db5674d1d6730afe8d9b499fb7a4a (diff)
downloadlinux-e2cb5f08469c991b187f66fa627d7673c7f3361b.tar.bz2
ACPI: replace kmalloc+memcpy with kmemdup
Replace the combination of kmalloc() and memcpy() in acpi_run_osc() with a single call to kmemdup(). [rjw: Changelog] Signed-off-by: Andrei Epure <epure.andrei@gmail.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/acpi/bus.c')
-rw-r--r--drivers/acpi/bus.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c
index 01708a165368..292de3cab9cc 100644
--- a/drivers/acpi/bus.c
+++ b/drivers/acpi/bus.c
@@ -288,13 +288,12 @@ acpi_status acpi_run_osc(acpi_handle handle, struct acpi_osc_context *context)
}
out_success:
context->ret.length = out_obj->buffer.length;
- context->ret.pointer = kmalloc(context->ret.length, GFP_KERNEL);
+ context->ret.pointer = kmemdup(out_obj->buffer.pointer,
+ context->ret.length, GFP_KERNEL);
if (!context->ret.pointer) {
status = AE_NO_MEMORY;
goto out_kfree;
}
- memcpy(context->ret.pointer, out_obj->buffer.pointer,
- context->ret.length);
status = AE_OK;
out_kfree: