Commit a2535636 authored by Andrew Morton's avatar Andrew Morton Committed by James Toy

convert to kstrdup() as well.

Cc: Julia Lawall <julia@diku.dk>
Cc: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent 85712605
...@@ -715,12 +715,11 @@ int au1100fb_setup(char *options) ...@@ -715,12 +715,11 @@ int au1100fb_setup(char *options)
} }
/* Mode option (only option that start with digit) */ /* Mode option (only option that start with digit) */
else if (isdigit(this_opt[0])) { else if (isdigit(this_opt[0])) {
mode = kmalloc(strlen(this_opt) + 1, GFP_KERNEL); mode = kstrdup(this_opt, GFP_KERNEL);
if (!mode) { if (!mode) {
print_err("memory allocation failed"); print_err("memory allocation failed");
return -ENOMEM; return -ENOMEM;
} }
strncpy(mode, this_opt, strlen(this_opt) + 1);
} }
/* Unsupported option */ /* Unsupported option */
else { else {
......
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