[PATCH 06/31] arch/powerpc/pseries: use kmemdup rather than duplicating its implementation

Subsystems: linux for powerpc (32-bit and 64-bit), the rest

STALE3970d

3 messages, 3 authors, 2015-08-19 · open the first message on its own page

[PATCH 06/31] arch/powerpc/pseries: use kmemdup rather than duplicating its implementation

From: Andrzej Hajda <hidden>
Date: 2015-08-07 08:16:29

The patch was generated using fixed coccinelle semantic patch
scripts/coccinelle/api/memdup.cocci [1].

[1]: http://permalink.gmane.org/gmane.linux.kernel/2014320

Signed-off-by: Andrzej Hajda <redacted>
---
 arch/powerpc/platforms/pseries/hotplug-memory.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/arch/powerpc/platforms/pseries/hotplug-memory.c b/arch/powerpc/platforms/pseries/hotplug-memory.c
index 0ced387..e9ff44c 100644
--- a/arch/powerpc/platforms/pseries/hotplug-memory.c
+++ b/arch/powerpc/platforms/pseries/hotplug-memory.c
@@ -92,13 +92,12 @@ static struct property *dlpar_clone_drconf_property(struct device_node *dn)
 		return NULL;
 
 	new_prop->name = kstrdup(prop->name, GFP_KERNEL);
-	new_prop->value = kmalloc(prop->length, GFP_KERNEL);
+	new_prop->value = kmemdup(prop->value, prop->length, GFP_KERNEL);
 	if (!new_prop->name || !new_prop->value) {
 		dlpar_free_drconf_property(new_prop);
 		return NULL;
 	}
 
-	memcpy(new_prop->value, prop->value, prop->length);
 	new_prop->length = prop->length;
 
 	/* Convert the property to cpu endian-ness */
-- 
1.9.1

Re: [PATCH 06/31] arch/powerpc/pseries: use kmemdup rather than duplicating its implementation

From: Nathan Fontenot <hidden>
Date: 2015-08-07 19:46:52

On 08/07/2015 02:59 AM, Andrzej Hajda wrote:
The patch was generated using fixed coccinelle semantic patch
scripts/coccinelle/api/memdup.cocci [1].

[1]: http://permalink.gmane.org/gmane.linux.kernel/2014320

Signed-off-by: Andrzej Hajda <redacted>
Reviewed-by: Nathan Fontenot <redacted>

Re: [06/31] arch/powerpc/pseries: use kmemdup rather than duplicating its implementation

From: Michael Ellerman <mpe@ellerman.id.au>
Date: 2015-08-19 23:14:17

On Fri, 2015-07-08 at 07:59:12 UTC, Andrzej Hajda wrote:
The patch was generated using fixed coccinelle semantic patch
scripts/coccinelle/api/memdup.cocci [1].

[1]: http://permalink.gmane.org/gmane.linux.kernel/2014320

Signed-off-by: Andrzej Hajda <redacted>
Reviewed-by: Nathan Fontenot <redacted>
Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/2e16acc5ee3626bcd32e

cheers
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help