mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-10 07:10:27 +00:00
net: 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>
This commit is contained in:
parent
2015de5fe2
commit
d4cae56219
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user