All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] acpi: replaced kmalloc+memcpy with kmemdup
@ 2013-03-11  8:20 Andrei Epure
  2013-03-26 13:25 ` Rafael J. Wysocki
  0 siblings, 1 reply; 2+ messages in thread
From: Andrei Epure @ 2013-03-11  8:20 UTC (permalink / raw)
  To: lenb, rjw, linux-acpi; +Cc: linux-kernel, Andrei Epure

Signed-off-by: Andrei Epure <epure.andrei@gmail.com>
---
 drivers/acpi/bus.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c
index 01708a1..292de3c 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:
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-03-26 13:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-11  8:20 [PATCH] acpi: replaced kmalloc+memcpy with kmemdup Andrei Epure
2013-03-26 13:25 ` Rafael J. Wysocki

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.