diff options
Diffstat (limited to 'net/ipv4/devinet.c')
-rw-r--r-- | net/ipv4/devinet.c | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c index 56fce3ab6c55..309997edc8a5 100644 --- a/net/ipv4/devinet.c +++ b/net/ipv4/devinet.c | |||
@@ -112,13 +112,7 @@ static inline void devinet_sysctl_unregister(struct in_device *idev) | |||
112 | 112 | ||
113 | static struct in_ifaddr *inet_alloc_ifa(void) | 113 | static struct in_ifaddr *inet_alloc_ifa(void) |
114 | { | 114 | { |
115 | struct in_ifaddr *ifa = kzalloc(sizeof(*ifa), GFP_KERNEL); | 115 | return kzalloc(sizeof(struct in_ifaddr), GFP_KERNEL); |
116 | |||
117 | if (ifa) { | ||
118 | INIT_RCU_HEAD(&ifa->rcu_head); | ||
119 | } | ||
120 | |||
121 | return ifa; | ||
122 | } | 116 | } |
123 | 117 | ||
124 | static void inet_rcu_free_ifa(struct rcu_head *head) | 118 | static void inet_rcu_free_ifa(struct rcu_head *head) |
@@ -161,7 +155,6 @@ static struct in_device *inetdev_init(struct net_device *dev) | |||
161 | in_dev = kzalloc(sizeof(*in_dev), GFP_KERNEL); | 155 | in_dev = kzalloc(sizeof(*in_dev), GFP_KERNEL); |
162 | if (!in_dev) | 156 | if (!in_dev) |
163 | goto out; | 157 | goto out; |
164 | INIT_RCU_HEAD(&in_dev->rcu_head); | ||
165 | memcpy(&in_dev->cnf, dev_net(dev)->ipv4.devconf_dflt, | 158 | memcpy(&in_dev->cnf, dev_net(dev)->ipv4.devconf_dflt, |
166 | sizeof(in_dev->cnf)); | 159 | sizeof(in_dev->cnf)); |
167 | in_dev->cnf.sysctl = NULL; | 160 | in_dev->cnf.sysctl = NULL; |
@@ -1108,7 +1101,7 @@ out: | |||
1108 | } | 1101 | } |
1109 | 1102 | ||
1110 | static struct notifier_block ip_netdev_notifier = { | 1103 | static struct notifier_block ip_netdev_notifier = { |
1111 | .notifier_call =inetdev_event, | 1104 | .notifier_call = inetdev_event, |
1112 | }; | 1105 | }; |
1113 | 1106 | ||
1114 | static inline size_t inet_nlmsg_size(void) | 1107 | static inline size_t inet_nlmsg_size(void) |
@@ -1195,7 +1188,7 @@ done: | |||
1195 | return skb->len; | 1188 | return skb->len; |
1196 | } | 1189 | } |
1197 | 1190 | ||
1198 | static void rtmsg_ifa(int event, struct in_ifaddr* ifa, struct nlmsghdr *nlh, | 1191 | static void rtmsg_ifa(int event, struct in_ifaddr *ifa, struct nlmsghdr *nlh, |
1199 | u32 pid) | 1192 | u32 pid) |
1200 | { | 1193 | { |
1201 | struct sk_buff *skb; | 1194 | struct sk_buff *skb; |
@@ -1262,7 +1255,7 @@ static void inet_forward_change(struct net *net) | |||
1262 | } | 1255 | } |
1263 | 1256 | ||
1264 | static int devinet_conf_proc(ctl_table *ctl, int write, | 1257 | static int devinet_conf_proc(ctl_table *ctl, int write, |
1265 | struct file* filp, void __user *buffer, | 1258 | struct file *filp, void __user *buffer, |
1266 | size_t *lenp, loff_t *ppos) | 1259 | size_t *lenp, loff_t *ppos) |
1267 | { | 1260 | { |
1268 | int ret = proc_dointvec(ctl, write, filp, buffer, lenp, ppos); | 1261 | int ret = proc_dointvec(ctl, write, filp, buffer, lenp, ppos); |
@@ -1334,7 +1327,7 @@ static int devinet_conf_sysctl(ctl_table *table, | |||
1334 | } | 1327 | } |
1335 | 1328 | ||
1336 | static int devinet_sysctl_forward(ctl_table *ctl, int write, | 1329 | static int devinet_sysctl_forward(ctl_table *ctl, int write, |
1337 | struct file* filp, void __user *buffer, | 1330 | struct file *filp, void __user *buffer, |
1338 | size_t *lenp, loff_t *ppos) | 1331 | size_t *lenp, loff_t *ppos) |
1339 | { | 1332 | { |
1340 | int *valp = ctl->data; | 1333 | int *valp = ctl->data; |
@@ -1363,7 +1356,7 @@ static int devinet_sysctl_forward(ctl_table *ctl, int write, | |||
1363 | } | 1356 | } |
1364 | 1357 | ||
1365 | int ipv4_doint_and_flush(ctl_table *ctl, int write, | 1358 | int ipv4_doint_and_flush(ctl_table *ctl, int write, |
1366 | struct file* filp, void __user *buffer, | 1359 | struct file *filp, void __user *buffer, |
1367 | size_t *lenp, loff_t *ppos) | 1360 | size_t *lenp, loff_t *ppos) |
1368 | { | 1361 | { |
1369 | int *valp = ctl->data; | 1362 | int *valp = ctl->data; |