diff options
Diffstat (limited to 'net/ipv6')
-rw-r--r-- | net/ipv6/addrconf.c | 10 | ||||
-rw-r--r-- | net/ipv6/ipcomp6.c | 5 |
2 files changed, 10 insertions, 5 deletions
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index 01c62a0d3742..445006ee4522 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c | |||
@@ -143,7 +143,7 @@ static void inet6_prefix_notify(int event, struct inet6_dev *idev, | |||
143 | struct prefix_info *pinfo); | 143 | struct prefix_info *pinfo); |
144 | static int ipv6_chk_same_addr(const struct in6_addr *addr, struct net_device *dev); | 144 | static int ipv6_chk_same_addr(const struct in6_addr *addr, struct net_device *dev); |
145 | 145 | ||
146 | static struct notifier_block *inet6addr_chain; | 146 | static ATOMIC_NOTIFIER_HEAD(inet6addr_chain); |
147 | 147 | ||
148 | struct ipv6_devconf ipv6_devconf = { | 148 | struct ipv6_devconf ipv6_devconf = { |
149 | .forwarding = 0, | 149 | .forwarding = 0, |
@@ -593,7 +593,7 @@ out2: | |||
593 | read_unlock_bh(&addrconf_lock); | 593 | read_unlock_bh(&addrconf_lock); |
594 | 594 | ||
595 | if (likely(err == 0)) | 595 | if (likely(err == 0)) |
596 | notifier_call_chain(&inet6addr_chain, NETDEV_UP, ifa); | 596 | atomic_notifier_call_chain(&inet6addr_chain, NETDEV_UP, ifa); |
597 | else { | 597 | else { |
598 | kfree(ifa); | 598 | kfree(ifa); |
599 | ifa = ERR_PTR(err); | 599 | ifa = ERR_PTR(err); |
@@ -688,7 +688,7 @@ static void ipv6_del_addr(struct inet6_ifaddr *ifp) | |||
688 | 688 | ||
689 | ipv6_ifa_notify(RTM_DELADDR, ifp); | 689 | ipv6_ifa_notify(RTM_DELADDR, ifp); |
690 | 690 | ||
691 | notifier_call_chain(&inet6addr_chain,NETDEV_DOWN,ifp); | 691 | atomic_notifier_call_chain(&inet6addr_chain, NETDEV_DOWN, ifp); |
692 | 692 | ||
693 | addrconf_del_timer(ifp); | 693 | addrconf_del_timer(ifp); |
694 | 694 | ||
@@ -3767,12 +3767,12 @@ static void addrconf_sysctl_unregister(struct ipv6_devconf *p) | |||
3767 | 3767 | ||
3768 | int register_inet6addr_notifier(struct notifier_block *nb) | 3768 | int register_inet6addr_notifier(struct notifier_block *nb) |
3769 | { | 3769 | { |
3770 | return notifier_chain_register(&inet6addr_chain, nb); | 3770 | return atomic_notifier_chain_register(&inet6addr_chain, nb); |
3771 | } | 3771 | } |
3772 | 3772 | ||
3773 | int unregister_inet6addr_notifier(struct notifier_block *nb) | 3773 | int unregister_inet6addr_notifier(struct notifier_block *nb) |
3774 | { | 3774 | { |
3775 | return notifier_chain_unregister(&inet6addr_chain,nb); | 3775 | return atomic_notifier_chain_unregister(&inet6addr_chain,nb); |
3776 | } | 3776 | } |
3777 | 3777 | ||
3778 | /* | 3778 | /* |
diff --git a/net/ipv6/ipcomp6.c b/net/ipv6/ipcomp6.c index 028b636687ec..d4cfec3f414e 100644 --- a/net/ipv6/ipcomp6.c +++ b/net/ipv6/ipcomp6.c | |||
@@ -228,6 +228,9 @@ static struct xfrm_state *ipcomp6_tunnel_create(struct xfrm_state *x) | |||
228 | 228 | ||
229 | t->id.proto = IPPROTO_IPV6; | 229 | t->id.proto = IPPROTO_IPV6; |
230 | t->id.spi = xfrm6_tunnel_alloc_spi((xfrm_address_t *)&x->props.saddr); | 230 | t->id.spi = xfrm6_tunnel_alloc_spi((xfrm_address_t *)&x->props.saddr); |
231 | if (!t->id.spi) | ||
232 | goto error; | ||
233 | |||
231 | memcpy(t->id.daddr.a6, x->id.daddr.a6, sizeof(struct in6_addr)); | 234 | memcpy(t->id.daddr.a6, x->id.daddr.a6, sizeof(struct in6_addr)); |
232 | memcpy(&t->sel, &x->sel, sizeof(t->sel)); | 235 | memcpy(&t->sel, &x->sel, sizeof(t->sel)); |
233 | t->props.family = AF_INET6; | 236 | t->props.family = AF_INET6; |
@@ -243,7 +246,9 @@ out: | |||
243 | return t; | 246 | return t; |
244 | 247 | ||
245 | error: | 248 | error: |
249 | t->km.state = XFRM_STATE_DEAD; | ||
246 | xfrm_state_put(t); | 250 | xfrm_state_put(t); |
251 | t = NULL; | ||
247 | goto out; | 252 | goto out; |
248 | } | 253 | } |
249 | 254 | ||