diff options
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; |