aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/isdn/capi/capi.c
diff options
context:
space:
mode:
authorBurman Yan <yan_952@hotmail.com>2006-12-08 05:39:35 -0500
committerLinus Torvalds <torvalds@woody.osdl.org>2006-12-08 11:29:01 -0500
commit41f96935b4c41daea2c4dbbf137960375cf764c1 (patch)
tree9af3af5e41f68baf063b5f929797c837169bb9df /drivers/isdn/capi/capi.c
parent0b2dd130a5a8774a30de1f94266f6b9a9892153c (diff)
[PATCH] isdn: replace kmalloc+memset with kzalloc
Acked-by: Karsten Keil <kkeil@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/isdn/capi/capi.c')
-rw-r--r--drivers/isdn/capi/capi.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/isdn/capi/capi.c b/drivers/isdn/capi/capi.c
index 0475a54df83a..d22c0224fde6 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)
215 unsigned int minor = 0; 215 unsigned int minor = 0;
216 unsigned long flags; 216 unsigned long flags;
217 217
218 mp = kmalloc(sizeof(*mp), GFP_ATOMIC); 218 mp = kzalloc(sizeof(*mp), GFP_ATOMIC);
219 if (!mp) { 219 if (!mp) {
220 printk(KERN_ERR "capi: can't alloc capiminor\n"); 220 printk(KERN_ERR "capi: can't alloc capiminor\n");
221 return NULL; 221 return NULL;
222 } 222 }
223 223
224 memset(mp, 0, sizeof(struct capiminor));
225 mp->ap = ap; 224 mp->ap = ap;
226 mp->ncci = ncci; 225 mp->ncci = ncci;
227 mp->msgid = 0; 226 mp->msgid = 0;
@@ -304,10 +303,9 @@ static struct capincci *capincci_alloc(struct capidev *cdev, u32 ncci)
304 struct capiminor *mp = NULL; 303 struct capiminor *mp = NULL;
305#endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */ 304#endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */
306 305
307 np = kmalloc(sizeof(*np), GFP_ATOMIC); 306 np = kzalloc(sizeof(*np), GFP_ATOMIC);
308 if (!np) 307 if (!np)
309 return NULL; 308 return NULL;
310 memset(np, 0, sizeof(struct capincci));
311 np->ncci = ncci; 309 np->ncci = ncci;
312 np->cdev = cdev; 310 np->cdev = cdev;
313#ifdef CONFIG_ISDN_CAPI_MIDDLEWARE 311#ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
@@ -384,10 +382,9 @@ static struct capidev *capidev_alloc(void)
384 struct capidev *cdev; 382 struct capidev *cdev;
385 unsigned long flags; 383 unsigned long flags;
386 384
387 cdev = kmalloc(sizeof(*cdev), GFP_KERNEL); 385 cdev = kzalloc(sizeof(*cdev), GFP_KERNEL);
388 if (!cdev) 386 if (!cdev)
389 return NULL; 387 return NULL;
390 memset(cdev, 0, sizeof(struct capidev));
391 388
392 init_MUTEX(&cdev->ncci_list_sem); 389 init_MUTEX(&cdev->ncci_list_sem);
393 skb_queue_head_init(&cdev->recvqueue); 390 skb_queue_head_init(&cdev->recvqueue);