summaryrefslogtreecommitdiff
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-05 15:40:38 -0700
commit89384f646287437ba18afb28ccb125d5866a7209 (patch)
tree02c5bdf696cce7f620b6328d2e1dbb1706252445 /drivers/mtd
parent1360246a4f28e53d1fea30dfdff04245e54110c8 (diff)
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;
}