mirror of
https://github.com/torvalds/linux.git
synced 2025-01-01 15:51:46 +00:00
xfrm: avoid possible oopse in xfrm_alloc_dst
Commit 80c802f307
(xfrm: cache bundles instead of policies for
outgoing flows) introduced possible oopse when dst_alloc returns NULL.
Signed-off-by: Hiroaki SHIMODA <shimoda.hiroaki@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
520732af91
commit
0b15093219
@ -1340,10 +1340,13 @@ static inline struct xfrm_dst *xfrm_alloc_dst(struct net *net, int family)
|
|||||||
default:
|
default:
|
||||||
BUG();
|
BUG();
|
||||||
}
|
}
|
||||||
xdst = dst_alloc(dst_ops) ?: ERR_PTR(-ENOBUFS);
|
xdst = dst_alloc(dst_ops);
|
||||||
xfrm_policy_put_afinfo(afinfo);
|
xfrm_policy_put_afinfo(afinfo);
|
||||||
|
|
||||||
|
if (likely(xdst))
|
||||||
xdst->flo.ops = &xfrm_bundle_fc_ops;
|
xdst->flo.ops = &xfrm_bundle_fc_ops;
|
||||||
|
else
|
||||||
|
xdst = ERR_PTR(-ENOBUFS);
|
||||||
|
|
||||||
return xdst;
|
return xdst;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user