From: Madalin Bucur Date: Mon, 26 Sep 2011 07:04:56 +0000 (+0000) Subject: ipv6: check return value for dst_alloc X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=fbe58186901155c0cb5398dd343337be0c456c04;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.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 1250f902067..fb545edef6e 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; }