]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
drivers/parport/share.c: use kzalloc
authorAlexandru Gheorghiu <gheorghiuandru@gmail.com>
Thu, 9 May 2013 23:57:50 +0000 (09:57 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Tue, 21 May 2013 04:18:00 +0000 (14:18 +1000)
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>
drivers/parport/share.c

index a848e02e6be3d4537b5dd94c7017ec799cf7becb..6a83ee1e9178c118dabb6f318e40c447aa7d3d6d 100644 (file)
@@ -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;