staging: sm750fb: Use kzalloc rather than kmalloc followed by memset with 0
authorMadhusudhanan Ravindran <mravindran04@gmail.com>
Tue, 10 Mar 2015 17:37:39 +0000 (23:07 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 10 Mar 2015 20:13:55 +0000 (21:13 +0100)
The semantic patch that makes this change is available
in scriptcoccinelle/api/alloc/kzalloc-simple.cocci.

Signed-off-by: Madhusudhanan Ravindran <mravindran04@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/sm750fb/sm750.c

index 5532a28e60305f97fb8567982993eb95247f5a00..aa0888c232b9a2ad10b3c519b9058dd436e73859 100644 (file)
@@ -1278,11 +1278,10 @@ static int __init lynxfb_setup(char * options)
        pr_info("options:%s\n",options);
 
        len = strlen(options) + 1;
-       g_settings = kmalloc(len,GFP_KERNEL);
+       g_settings = kzalloc(len, GFP_KERNEL);
        if(!g_settings)
                return -ENOMEM;
 
-       memset(g_settings,0,len);
        tmp = g_settings;
 
        /*      Notes: