diff options
author | Panagiotis Issaris <takis@issaris.org> | 2006-07-21 17:51:30 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2006-07-21 17:51:30 -0400 |
commit | 0da974f4f303a6842516b764507e3c0a03f41e5a (patch) | |
tree | 8872aec792f02040269c6769dd1009b20f71d186 /net/atm | |
parent | a0ee7c70b22f78593957f99faa06acb4747b8bc0 (diff) |
[NET]: Conversions from kmalloc+memset to k(z|c)alloc.
Signed-off-by: Panagiotis Issaris <takis@issaris.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/atm')
-rw-r--r-- | net/atm/br2684.c | 3 | ||||
-rw-r--r-- | net/atm/clip.c | 3 | ||||
-rw-r--r-- | net/atm/lec.c | 3 | ||||
-rw-r--r-- | net/atm/mpc.c | 3 | ||||
-rw-r--r-- | net/atm/pppoatm.c | 3 | ||||
-rw-r--r-- | net/atm/resources.c | 3 |
6 files changed, 6 insertions, 12 deletions
diff --git a/net/atm/br2684.c b/net/atm/br2684.c index a487233dc466..d00cca97eb33 100644 --- a/net/atm/br2684.c +++ b/net/atm/br2684.c | |||
@@ -508,10 +508,9 @@ Note: we do not have explicit unassign, but look at _push() | |||
508 | 508 | ||
509 | if (copy_from_user(&be, arg, sizeof be)) | 509 | if (copy_from_user(&be, arg, sizeof be)) |
510 | return -EFAULT; | 510 | return -EFAULT; |
511 | brvcc = kmalloc(sizeof(struct br2684_vcc), GFP_KERNEL); | 511 | brvcc = kzalloc(sizeof(struct br2684_vcc), GFP_KERNEL); |
512 | if (!brvcc) | 512 | if (!brvcc) |
513 | return -ENOMEM; | 513 | return -ENOMEM; |
514 | memset(brvcc, 0, sizeof(struct br2684_vcc)); | ||
515 | write_lock_irq(&devs_lock); | 514 | write_lock_irq(&devs_lock); |
516 | net_dev = br2684_find_dev(&be.ifspec); | 515 | net_dev = br2684_find_dev(&be.ifspec); |
517 | if (net_dev == NULL) { | 516 | if (net_dev == NULL) { |
diff --git a/net/atm/clip.c b/net/atm/clip.c index 2e62105d91bd..7ce7bfe3fbad 100644 --- a/net/atm/clip.c +++ b/net/atm/clip.c | |||
@@ -929,12 +929,11 @@ static int arp_seq_open(struct inode *inode, struct file *file) | |||
929 | struct seq_file *seq; | 929 | struct seq_file *seq; |
930 | int rc = -EAGAIN; | 930 | int rc = -EAGAIN; |
931 | 931 | ||
932 | state = kmalloc(sizeof(*state), GFP_KERNEL); | 932 | state = kzalloc(sizeof(*state), GFP_KERNEL); |
933 | if (!state) { | 933 | if (!state) { |
934 | rc = -ENOMEM; | 934 | rc = -ENOMEM; |
935 | goto out_kfree; | 935 | goto out_kfree; |
936 | } | 936 | } |
937 | memset(state, 0, sizeof(*state)); | ||
938 | state->ns.neigh_sub_iter = clip_seq_sub_iter; | 937 | state->ns.neigh_sub_iter = clip_seq_sub_iter; |
939 | 938 | ||
940 | rc = seq_open(file, &arp_seq_ops); | 939 | rc = seq_open(file, &arp_seq_ops); |
diff --git a/net/atm/lec.c b/net/atm/lec.c index 4b68a18171cf..b4aa489849df 100644 --- a/net/atm/lec.c +++ b/net/atm/lec.c | |||
@@ -1811,12 +1811,11 @@ make_entry(struct lec_priv *priv, unsigned char *mac_addr) | |||
1811 | { | 1811 | { |
1812 | struct lec_arp_table *to_return; | 1812 | struct lec_arp_table *to_return; |
1813 | 1813 | ||
1814 | to_return = kmalloc(sizeof(struct lec_arp_table), GFP_ATOMIC); | 1814 | to_return = kzalloc(sizeof(struct lec_arp_table), GFP_ATOMIC); |
1815 | if (!to_return) { | 1815 | if (!to_return) { |
1816 | printk("LEC: Arp entry kmalloc failed\n"); | 1816 | printk("LEC: Arp entry kmalloc failed\n"); |
1817 | return NULL; | 1817 | return NULL; |
1818 | } | 1818 | } |
1819 | memset(to_return, 0, sizeof(struct lec_arp_table)); | ||
1820 | memcpy(to_return->mac_addr, mac_addr, ETH_ALEN); | 1819 | memcpy(to_return->mac_addr, mac_addr, ETH_ALEN); |
1821 | init_timer(&to_return->timer); | 1820 | init_timer(&to_return->timer); |
1822 | to_return->timer.function = lec_arp_expire_arp; | 1821 | to_return->timer.function = lec_arp_expire_arp; |
diff --git a/net/atm/mpc.c b/net/atm/mpc.c index 9aafe1e2f048..00704661e83f 100644 --- a/net/atm/mpc.c +++ b/net/atm/mpc.c | |||
@@ -258,10 +258,9 @@ static struct mpoa_client *alloc_mpc(void) | |||
258 | { | 258 | { |
259 | struct mpoa_client *mpc; | 259 | struct mpoa_client *mpc; |
260 | 260 | ||
261 | mpc = kmalloc(sizeof (struct mpoa_client), GFP_KERNEL); | 261 | mpc = kzalloc(sizeof (struct mpoa_client), GFP_KERNEL); |
262 | if (mpc == NULL) | 262 | if (mpc == NULL) |
263 | return NULL; | 263 | return NULL; |
264 | memset(mpc, 0, sizeof(struct mpoa_client)); | ||
265 | rwlock_init(&mpc->ingress_lock); | 264 | rwlock_init(&mpc->ingress_lock); |
266 | rwlock_init(&mpc->egress_lock); | 265 | rwlock_init(&mpc->egress_lock); |
267 | mpc->next = mpcs; | 266 | mpc->next = mpcs; |
diff --git a/net/atm/pppoatm.c b/net/atm/pppoatm.c index 76a7d8ff6c0e..19d5dfc0702f 100644 --- a/net/atm/pppoatm.c +++ b/net/atm/pppoatm.c | |||
@@ -287,10 +287,9 @@ static int pppoatm_assign_vcc(struct atm_vcc *atmvcc, void __user *arg) | |||
287 | if (be.encaps != PPPOATM_ENCAPS_AUTODETECT && | 287 | if (be.encaps != PPPOATM_ENCAPS_AUTODETECT && |
288 | be.encaps != PPPOATM_ENCAPS_VC && be.encaps != PPPOATM_ENCAPS_LLC) | 288 | be.encaps != PPPOATM_ENCAPS_VC && be.encaps != PPPOATM_ENCAPS_LLC) |
289 | return -EINVAL; | 289 | return -EINVAL; |
290 | pvcc = kmalloc(sizeof(*pvcc), GFP_KERNEL); | 290 | pvcc = kzalloc(sizeof(*pvcc), GFP_KERNEL); |
291 | if (pvcc == NULL) | 291 | if (pvcc == NULL) |
292 | return -ENOMEM; | 292 | return -ENOMEM; |
293 | memset(pvcc, 0, sizeof(*pvcc)); | ||
294 | pvcc->atmvcc = atmvcc; | 293 | pvcc->atmvcc = atmvcc; |
295 | pvcc->old_push = atmvcc->push; | 294 | pvcc->old_push = atmvcc->push; |
296 | pvcc->old_pop = atmvcc->pop; | 295 | pvcc->old_pop = atmvcc->pop; |
diff --git a/net/atm/resources.c b/net/atm/resources.c index de25c6408b04..529f7e64aa2c 100644 --- a/net/atm/resources.c +++ b/net/atm/resources.c | |||
@@ -33,10 +33,9 @@ static struct atm_dev *__alloc_atm_dev(const char *type) | |||
33 | { | 33 | { |
34 | struct atm_dev *dev; | 34 | struct atm_dev *dev; |
35 | 35 | ||
36 | dev = kmalloc(sizeof(*dev), GFP_KERNEL); | 36 | dev = kzalloc(sizeof(*dev), GFP_KERNEL); |
37 | if (!dev) | 37 | if (!dev) |
38 | return NULL; | 38 | return NULL; |
39 | memset(dev, 0, sizeof(*dev)); | ||
40 | dev->type = type; | 39 | dev->type = type; |
41 | dev->signal = ATM_PHY_SIG_UNKNOWN; | 40 | dev->signal = ATM_PHY_SIG_UNKNOWN; |
42 | dev->link_rate = ATM_OC3_PCR; | 41 | dev->link_rate = ATM_OC3_PCR; |