Commit 89384f64 authored by Fabian Frederick's avatar Fabian Frederick Committed by Brian Norris

mtd: phram: replace kmalloc/strcpy by kstrdup

Cc: Joern Engel <joern@lazybastard.org>
Signed-off-by: default avatarFabian Frederick <fabf@skynet.be>
Signed-off-by: default avatarBrian Norris <computersforpeace@gmail.com>
parent 1360246a
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment