提交 fbe58186 编写于 作者: M Madalin Bucur 提交者: David S. Miller

ipv6: check return value for dst_alloc

return value of dst_alloc must be checked before use
Signed-off-by: NMadalin Bucur <madalin.bucur@freescale.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 d4cae562
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册