From: Madalin Bucur Date: Mon, 26 Sep 2011 07:04:56 +0000 (+0000) Subject: ipv6: check return value for dst_alloc X-Git-Tag: firefly_0821_release~7613^2~108 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=a0e6c2f9f297c760797980d9ccfe2eb00fc5b46d;p=firefly-linux-kernel-4.4.55.git ipv6: check return value for dst_alloc return value of dst_alloc must be checked before use Signed-off-by: Madalin Bucur Signed-off-by: David S. Miller --- diff --git a/net/ipv6/route.c b/net/ipv6/route.c index 8e600f827fe7..7ef5d0820185 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c @@ -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; }