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/decnet/dn_dev.c | |
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/decnet/dn_dev.c')
-rw-r--r-- | net/decnet/dn_dev.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/net/decnet/dn_dev.c b/net/decnet/dn_dev.c index 98a25208440d..476455fbdb03 100644 --- a/net/decnet/dn_dev.c +++ b/net/decnet/dn_dev.c | |||
@@ -413,11 +413,7 @@ static struct dn_ifaddr *dn_dev_alloc_ifa(void) | |||
413 | { | 413 | { |
414 | struct dn_ifaddr *ifa; | 414 | struct dn_ifaddr *ifa; |
415 | 415 | ||
416 | ifa = kmalloc(sizeof(*ifa), GFP_KERNEL); | 416 | ifa = kzalloc(sizeof(*ifa), GFP_KERNEL); |
417 | |||
418 | if (ifa) { | ||
419 | memset(ifa, 0, sizeof(*ifa)); | ||
420 | } | ||
421 | 417 | ||
422 | return ifa; | 418 | return ifa; |
423 | } | 419 | } |
@@ -1105,10 +1101,9 @@ struct dn_dev *dn_dev_create(struct net_device *dev, int *err) | |||
1105 | return NULL; | 1101 | return NULL; |
1106 | 1102 | ||
1107 | *err = -ENOBUFS; | 1103 | *err = -ENOBUFS; |
1108 | if ((dn_db = kmalloc(sizeof(struct dn_dev), GFP_ATOMIC)) == NULL) | 1104 | if ((dn_db = kzalloc(sizeof(struct dn_dev), GFP_ATOMIC)) == NULL) |
1109 | return NULL; | 1105 | return NULL; |
1110 | 1106 | ||
1111 | memset(dn_db, 0, sizeof(struct dn_dev)); | ||
1112 | memcpy(&dn_db->parms, p, sizeof(struct dn_dev_parms)); | 1107 | memcpy(&dn_db->parms, p, sizeof(struct dn_dev_parms)); |
1113 | smp_wmb(); | 1108 | smp_wmb(); |
1114 | dev->dn_ptr = dn_db; | 1109 | dev->dn_ptr = dn_db; |