]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - net/ipv6/route.c
Merge branch 'next/cleanup3' of git://git.linaro.org/people/arnd/arm-soc
[karo-tx-linux.git] / net / ipv6 / route.c
index 1250f902067016d694ea59910778555ad68702bc..57b82dc1ae91c8426b0894b5e4e6030453c66352 100644 (file)
@@ -244,7 +244,9 @@ static inline struct rt6_info *ip6_dst_alloc(struct dst_ops *ops,
 {
        struct rt6_info *rt = dst_alloc(ops, dev, 0, 0, flags);
 
-       memset(&rt->rt6i_table, 0, sizeof(*rt) - sizeof(struct dst_entry));
+       if (rt != NULL)
+               memset(&rt->rt6i_table, 0,
+                       sizeof(*rt) - sizeof(struct dst_entry));
 
        return rt;
 }
@@ -1084,11 +1086,10 @@ struct dst_entry *icmp6_dst_alloc(struct net_device *dev,
        rt->dst.output  = ip6_output;
        dst_set_neighbour(&rt->dst, neigh);
        atomic_set(&rt->dst.__refcnt, 1);
-       dst_metric_set(&rt->dst, RTAX_HOPLIMIT, 255);
-
        ipv6_addr_copy(&rt->rt6i_dst.addr, addr);
        rt->rt6i_dst.plen = 128;
        rt->rt6i_idev     = idev;
+       dst_metric_set(&rt->dst, RTAX_HOPLIMIT, 255);
 
        spin_lock_bh(&icmp6_dst_lock);
        rt->dst.next = icmp6_dst_gc_list;