From: Madalin Bucur Date: Mon, 26 Sep 2011 07:04:56 +0000 (+0000) Subject: ipv6: check return value for dst_alloc X-Git-Tag: upstream/snapshot3+hdmi~9017^2~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fbe58186901155c0cb5398dd343337be0c456c04;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.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 1250f90..fb545ed 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c @@ -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; }