Merge remote-tracking branch 'stable/linux-3.0.y' into develop-3.0-jb
[firefly-linux-kernel-4.4.55.git] / net / ipv6 / route.c
index 7c5b4cb883829d2cdbd7649a61002a508a8b6fae..a6e78020eeb5720d68110c0f21ee18d7d5b2731d 100644 (file)
@@ -233,7 +233,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;
 }