Skip to content

Commit

Permalink
staging: sm750fb: Use kzalloc rather than kmalloc followed by memset …
Browse files Browse the repository at this point in the history
…with 0

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>
  • Loading branch information
mravindran04 authored and gregkh committed Mar 10, 2015
1 parent 0fa96e3 commit a99e334
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/staging/sm750fb/sm750.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit a99e334

Please sign in to comment.