summaryrefslogtreecommitdiffstats
path: root/net/ipv6/route.c
diff options
context:
space:
mode:
authorMadalin Bucur <madalin.bucur@freescale.com>2011-09-26 09:04:56 +0200
committerDavid S. Miller <davem@davemloft.net>2011-09-27 21:32:06 +0200
commitfbe58186901155c0cb5398dd343337be0c456c04 (patch)
treeb2c9097cd838cd7b2bc6a37b57bc3abb04d5939c /net/ipv6/route.c
parentnet: check return value for dst_alloc (diff)
downloadlinux-fbe58186901155c0cb5398dd343337be0c456c04.tar.xz
linux-fbe58186901155c0cb5398dd343337be0c456c04.zip
ipv6: check return value for dst_alloc
return value of dst_alloc must be checked before use Signed-off-by: Madalin Bucur <madalin.bucur@freescale.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/route.c')
-rw-r--r--net/ipv6/route.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 1250f9020670..fb545edef6ea 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;
}