aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/isdn/i4l/isdn_common.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/i4l/isdn_common.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/i4l/isdn_common.c')
-rw-r--r--drivers/isdn/i4l/isdn_common.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/isdn/i4l/isdn_common.c b/drivers/isdn/i4l/isdn_common.c
index a610a05aa217..6a2ef0a87ed9 100644
--- a/drivers/isdn/i4l/isdn_common.c
+++ b/drivers/isdn/i4l/isdn_common.c
@@ -2072,21 +2072,19 @@ isdn_add_channels(isdn_driver_t *d, int drvidx, int n, int adding)
2072 2072
2073 if ((adding) && (d->rcverr)) 2073 if ((adding) && (d->rcverr))
2074 kfree(d->rcverr); 2074 kfree(d->rcverr);
2075 if (!(d->rcverr = kmalloc(sizeof(int) * m, GFP_ATOMIC))) { 2075 if (!(d->rcverr = kzalloc(sizeof(int) * m, GFP_ATOMIC))) {
2076 printk(KERN_WARNING "register_isdn: Could not alloc rcverr\n"); 2076 printk(KERN_WARNING "register_isdn: Could not alloc rcverr\n");
2077 return -1; 2077 return -1;
2078 } 2078 }
2079 memset((char *) d->rcverr, 0, sizeof(int) * m);
2080 2079
2081 if ((adding) && (d->rcvcount)) 2080 if ((adding) && (d->rcvcount))
2082 kfree(d->rcvcount); 2081 kfree(d->rcvcount);
2083 if (!(d->rcvcount = kmalloc(sizeof(int) * m, GFP_ATOMIC))) { 2082 if (!(d->rcvcount = kzalloc(sizeof(int) * m, GFP_ATOMIC))) {
2084 printk(KERN_WARNING "register_isdn: Could not alloc rcvcount\n"); 2083 printk(KERN_WARNING "register_isdn: Could not alloc rcvcount\n");
2085 if (!adding) 2084 if (!adding)
2086 kfree(d->rcverr); 2085 kfree(d->rcverr);
2087 return -1; 2086 return -1;
2088 } 2087 }
2089 memset((char *) d->rcvcount, 0, sizeof(int) * m);
2090 2088
2091 if ((adding) && (d->rpqueue)) { 2089 if ((adding) && (d->rpqueue)) {
2092 for (j = 0; j < d->channels; j++) 2090 for (j = 0; j < d->channels; j++)
@@ -2226,11 +2224,10 @@ register_isdn(isdn_if * i)
2226 printk(KERN_WARNING "register_isdn: No write routine given.\n"); 2224 printk(KERN_WARNING "register_isdn: No write routine given.\n");
2227 return 0; 2225 return 0;
2228 } 2226 }
2229 if (!(d = kmalloc(sizeof(isdn_driver_t), GFP_KERNEL))) { 2227 if (!(d = kzalloc(sizeof(isdn_driver_t), GFP_KERNEL))) {
2230 printk(KERN_WARNING "register_isdn: Could not alloc driver-struct\n"); 2228 printk(KERN_WARNING "register_isdn: Could not alloc driver-struct\n");
2231 return 0; 2229 return 0;
2232 } 2230 }
2233 memset((char *) d, 0, sizeof(isdn_driver_t));
2234 2231
2235 d->maxbufsize = i->maxbufsize; 2232 d->maxbufsize = i->maxbufsize;
2236 d->pktcount = 0; 2233 d->pktcount = 0;