summaryrefslogtreecommitdiffstats
path: root/drivers/mtd/devices/phram.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mtd/devices/phram.c')
-rw-r--r--drivers/mtd/devices/phram.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/mtd/devices/phram.c b/drivers/mtd/devices/phram.c
index 2cceebfb251e..3bac7dadf8d6 100644
--- a/drivers/mtd/devices/phram.c
+++ b/drivers/mtd/devices/phram.c
@@ -181,12 +181,10 @@ static int parse_name(char **pname, const char *token)
if (len > 64)
return -ENOSPC;
- name = kmalloc(len, GFP_KERNEL);
+ name = kstrdup(token, GFP_KERNEL);
if (!name)
return -ENOMEM;
- strcpy(name, token);
-
*pname = name;
return 0;
}