Skip to content

Commit

Permalink
ipv6: check return value for dst_alloc
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
madalinbucur authored and davem330 committed Sep 27, 2011
1 parent d4cae56 commit fbe5818
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion net/ipv6/route.c
Expand Up @@ -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;
}
Expand Down

0 comments on commit fbe5818

Please sign in to comment.