diff options
Diffstat (limited to 'net/ipv4/devinet.c')
-rw-r--r-- | net/ipv4/devinet.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c index a7c65e9e5ec9..a6cc31d911eb 100644 --- a/net/ipv4/devinet.c +++ b/net/ipv4/devinet.c | |||
@@ -93,10 +93,9 @@ static void devinet_sysctl_unregister(struct ipv4_devconf *p); | |||
93 | 93 | ||
94 | static struct in_ifaddr *inet_alloc_ifa(void) | 94 | static struct in_ifaddr *inet_alloc_ifa(void) |
95 | { | 95 | { |
96 | struct in_ifaddr *ifa = kmalloc(sizeof(*ifa), GFP_KERNEL); | 96 | struct in_ifaddr *ifa = kzalloc(sizeof(*ifa), GFP_KERNEL); |
97 | 97 | ||
98 | if (ifa) { | 98 | if (ifa) { |
99 | memset(ifa, 0, sizeof(*ifa)); | ||
100 | INIT_RCU_HEAD(&ifa->rcu_head); | 99 | INIT_RCU_HEAD(&ifa->rcu_head); |
101 | } | 100 | } |
102 | 101 | ||
@@ -140,10 +139,9 @@ struct in_device *inetdev_init(struct net_device *dev) | |||
140 | 139 | ||
141 | ASSERT_RTNL(); | 140 | ASSERT_RTNL(); |
142 | 141 | ||
143 | in_dev = kmalloc(sizeof(*in_dev), GFP_KERNEL); | 142 | in_dev = kzalloc(sizeof(*in_dev), GFP_KERNEL); |
144 | if (!in_dev) | 143 | if (!in_dev) |
145 | goto out; | 144 | goto out; |
146 | memset(in_dev, 0, sizeof(*in_dev)); | ||
147 | INIT_RCU_HEAD(&in_dev->rcu_head); | 145 | INIT_RCU_HEAD(&in_dev->rcu_head); |
148 | memcpy(&in_dev->cnf, &ipv4_devconf_dflt, sizeof(in_dev->cnf)); | 146 | memcpy(&in_dev->cnf, &ipv4_devconf_dflt, sizeof(in_dev->cnf)); |
149 | in_dev->cnf.sysctl = NULL; | 147 | in_dev->cnf.sysctl = NULL; |