Skip to content

Commit

Permalink
staging: ft1000: optimize kmalloc to kzalloc
Browse files Browse the repository at this point in the history
Use kzalloc rather than kmalloc followed by memset with 0.
Found by coccinelle.

Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Alexander Beregalov authored and Greg Kroah-Hartman committed Mar 9, 2011
1 parent 1840c15 commit 2f48131
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/staging/ft1000/ft1000-pcmcia/ft1000_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,10 @@ static int ft1000_attach(struct pcmcia_device *link)

DEBUG(0, "ft1000_cs: ft1000_attach()\n");

local = kmalloc(sizeof(local_info_t), GFP_KERNEL);
local = kzalloc(sizeof(local_info_t), GFP_KERNEL);
if (!local) {
return -ENOMEM;
}
memset(local, 0, sizeof(local_info_t));
local->link = link;

link->priv = local;
Expand Down

0 comments on commit 2f48131

Please sign in to comment.