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>
This commit is contained in:
Fabian Frederick 2014-05-28 22:31:28 +02:00 committed by Brian Norris
parent 1360246a4f
commit 89384f6462
1 changed files with 1 additions and 3 deletions

View File

@ -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;
}