From 41f96935b4c41daea2c4dbbf137960375cf764c1 Mon Sep 17 00:00:00 2001 From: Burman Yan Date: Fri, 8 Dec 2006 02:39:35 -0800 Subject: [PATCH] isdn: replace kmalloc+memset with kzalloc Acked-by: Karsten Keil Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/isdn/capi/capi.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'drivers/isdn/capi/capi.c') diff --git a/drivers/isdn/capi/capi.c b/drivers/isdn/capi/capi.c index 0475a54d..d22c022 100644 --- a/drivers/isdn/capi/capi.c +++ b/drivers/isdn/capi/capi.c @@ -215,13 +215,12 @@ static struct capiminor *capiminor_alloc(struct capi20_appl *ap, u32 ncci) unsigned int minor = 0; unsigned long flags; - mp = kmalloc(sizeof(*mp), GFP_ATOMIC); + mp = kzalloc(sizeof(*mp), GFP_ATOMIC); if (!mp) { printk(KERN_ERR "capi: can't alloc capiminor\n"); return NULL; } - memset(mp, 0, sizeof(struct capiminor)); mp->ap = ap; mp->ncci = ncci; mp->msgid = 0; @@ -304,10 +303,9 @@ static struct capincci *capincci_alloc(struct capidev *cdev, u32 ncci) struct capiminor *mp = NULL; #endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */ - np = kmalloc(sizeof(*np), GFP_ATOMIC); + np = kzalloc(sizeof(*np), GFP_ATOMIC); if (!np) return NULL; - memset(np, 0, sizeof(struct capincci)); np->ncci = ncci; np->cdev = cdev; #ifdef CONFIG_ISDN_CAPI_MIDDLEWARE @@ -384,10 +382,9 @@ static struct capidev *capidev_alloc(void) struct capidev *cdev; unsigned long flags; - cdev = kmalloc(sizeof(*cdev), GFP_KERNEL); + cdev = kzalloc(sizeof(*cdev), GFP_KERNEL); if (!cdev) return NULL; - memset(cdev, 0, sizeof(struct capidev)); init_MUTEX(&cdev->ncci_list_sem); skb_queue_head_init(&cdev->recvqueue); -- cgit v1.1