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

net: 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>
上级 2015de5f
...@@ -1349,14 +1349,16 @@ static inline struct xfrm_dst *xfrm_alloc_dst(struct net *net, int family) ...@@ -1349,14 +1349,16 @@ static inline struct xfrm_dst *xfrm_alloc_dst(struct net *net, int family)
BUG(); BUG();
} }
xdst = dst_alloc(dst_ops, NULL, 0, 0, 0); xdst = dst_alloc(dst_ops, NULL, 0, 0, 0);
memset(&xdst->u.rt6.rt6i_table, 0, sizeof(*xdst) - sizeof(struct dst_entry));
xfrm_policy_put_afinfo(afinfo);
if (likely(xdst)) if (likely(xdst)) {
memset(&xdst->u.rt6.rt6i_table, 0,
sizeof(*xdst) - sizeof(struct dst_entry));
xdst->flo.ops = &xfrm_bundle_fc_ops; xdst->flo.ops = &xfrm_bundle_fc_ops;
else } else
xdst = ERR_PTR(-ENOBUFS); xdst = ERR_PTR(-ENOBUFS);
xfrm_policy_put_afinfo(afinfo);
return xdst; return xdst;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册