summaryrefslogtreecommitdiffstats
path: root/drivers/mtd
diff options
context:
space:
mode:
authorFabian Frederick <fabf@skynet.be>2014-05-28 22:31:28 +0200
committerBrian Norris <computersforpeace@gmail.com>2014-07-06 00:40:38 +0200
commit89384f646287437ba18afb28ccb125d5866a7209 (patch)
tree02c5bdf696cce7f620b6328d2e1dbb1706252445 /drivers/mtd
parentmtd: bf5xx_nand: drop no-op PM support (diff)
downloadlinux-89384f646287437ba18afb28ccb125d5866a7209.tar.xz
linux-89384f646287437ba18afb28ccb125d5866a7209.zip
mtd: phram: replace kmalloc/strcpy by kstrdup
Cc: Joern Engel <joern@lazybastard.org> Signed-off-by: Fabian Frederick <fabf@skynet.be> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Diffstat (limited to 'drivers/mtd')
-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;
}