Skip to content

Commit

Permalink
drivers/parport/share.c: use kzalloc
Browse files Browse the repository at this point in the history
Replaced calls to kmalloc and memset with kzalloc.
Patch found using coccinelle.

Signed-off-by: Alexandru Gheorghiu <gheorghiuandru@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Alexandru Gheorghiu authored and Linus Torvalds committed Jul 3, 2013
1 parent 8da01af commit c32df4e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/parport/share.c
Original file line number Diff line number Diff line change
Expand Up @@ -282,14 +282,13 @@ struct parport *parport_register_port(unsigned long base, int irq, int dma,
int device;
char *name;

tmp = kmalloc(sizeof(struct parport), GFP_KERNEL);
tmp = kzalloc(sizeof(struct parport), GFP_KERNEL);
if (!tmp) {
printk(KERN_WARNING "parport: memory squeeze\n");
return NULL;
}

/* Init our structure */
memset(tmp, 0, sizeof(struct parport));
tmp->base = base;
tmp->irq = irq;
tmp->dma = dma;
Expand Down

0 comments on commit c32df4e

Please sign in to comment.