aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/pseries/reconfig.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/platforms/pseries/reconfig.c')
-rw-r--r--arch/powerpc/platforms/pseries/reconfig.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/arch/powerpc/platforms/pseries/reconfig.c b/arch/powerpc/platforms/pseries/reconfig.c
index 39f71fba9b38..2f4668136b20 100644
--- a/arch/powerpc/platforms/pseries/reconfig.c
+++ b/arch/powerpc/platforms/pseries/reconfig.c
@@ -281,12 +281,11 @@ static struct property *new_property(const char *name, const int length,
281 if (!new) 281 if (!new)
282 return NULL; 282 return NULL;
283 283
284 if (!(new->name = kmalloc(strlen(name) + 1, GFP_KERNEL))) 284 if (!(new->name = kstrdup(name, GFP_KERNEL)))
285 goto cleanup; 285 goto cleanup;
286 if (!(new->value = kmalloc(length + 1, GFP_KERNEL))) 286 if (!(new->value = kmalloc(length + 1, GFP_KERNEL)))
287 goto cleanup; 287 goto cleanup;
288 288
289 strcpy(new->name, name);
290 memcpy(new->value, value, length); 289 memcpy(new->value, value, length);
291 *(((char *)new->value) + length) = 0; 290 *(((char *)new->value) + length) = 0;
292 new->length = length; 291 new->length = length;