[IPV4] devinet: inetdev_init out label moved after RCU assignment
authorJarek Poplawski <jarkao2@o2.pl>
Tue, 9 Jan 2007 22:38:31 +0000 (14:38 -0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 9 Jan 2007 22:38:31 +0000 (14:38 -0800)
inetdev_init out label moved after RCU assignment
(final suggestion by Herbert Xu)

Signed-off-by: Jarek Poplawski <jarkao2@o2.pl>
Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/devinet.c

index 25c8a42965dff1d3eeea77f8ac8dad2809c33e28..480ace9819f6d97ea0245b742445481f7fcb14e5 100644 (file)
@@ -174,9 +174,10 @@ struct in_device *inetdev_init(struct net_device *dev)
        ip_mc_init_dev(in_dev);
        if (dev->flags & IFF_UP)
                ip_mc_up(in_dev);
-out:
+
        /* we can receive as soon as ip_ptr is set -- do this last */
        rcu_assign_pointer(dev->ip_ptr, in_dev);
+out:
        return in_dev;
 out_kfree:
        kfree(in_dev);