aboutsummaryrefslogtreecommitdiffstats
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)
181 if (len > 64) 181 if (len > 64)
182 return -ENOSPC; 182 return -ENOSPC;
183 183
184 name = kmalloc(len, GFP_KERNEL); 184 name = kstrdup(token, GFP_KERNEL);
185 if (!name) 185 if (!name)
186 return -ENOMEM; 186 return -ENOMEM;
187 187
188 strcpy(name, token);
189
190 *pname = name; 188 *pname = name;
191 return 0; 189 return 0;
192} 190}