diff options
-rw-r--r-- | drivers/video/au1100fb.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/video/au1100fb.c b/drivers/video/au1100fb.c index 378f27745a1d..a699aab63820 100644 --- a/drivers/video/au1100fb.c +++ b/drivers/video/au1100fb.c | |||
@@ -715,8 +715,11 @@ int au1100fb_setup(char *options) | |||
715 | } | 715 | } |
716 | /* Mode option (only option that start with digit) */ | 716 | /* Mode option (only option that start with digit) */ |
717 | else if (isdigit(this_opt[0])) { | 717 | else if (isdigit(this_opt[0])) { |
718 | mode = kmalloc(strlen(this_opt) + 1, GFP_KERNEL); | 718 | mode = kstrdup(this_opt, GFP_KERNEL); |
719 | strncpy(mode, this_opt, strlen(this_opt) + 1); | 719 | if (!mode) { |
720 | print_err("memory allocation failed"); | ||
721 | return -ENOMEM; | ||
722 | } | ||
720 | } | 723 | } |
721 | /* Unsupported option */ | 724 | /* Unsupported option */ |
722 | else { | 725 | else { |