diff options
author | Fabian Frederick <fabf@skynet.be> | 2014-05-29 00:31:28 +0400 |
---|---|---|
committer | Brian Norris <computersforpeace@gmail.com> | 2014-07-06 02:40:38 +0400 |
commit | 89384f646287437ba18afb28ccb125d5866a7209 (patch) | |
tree | 02c5bdf696cce7f620b6328d2e1dbb1706252445 /drivers/mtd | |
parent | 1360246a4f28e53d1fea30dfdff04245e54110c8 (diff) | |
download | linux-89384f646287437ba18afb28ccb125d5866a7209.tar.xz |
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.c | 4 |
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; } |