projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
520732a
)
xfrm: avoid possible oopse in xfrm_alloc_dst
author
Hiroaki SHIMODA
<
[email protected]
>
Fri, 11 Feb 2011 07:08:33 +0000
(23:08 -0800)
committer
David S. Miller
<
[email protected]
>
Fri, 11 Feb 2011 07:08:33 +0000
(23:08 -0800)
Commit
80c802f3073e84
(xfrm: cache bundles instead of policies for
outgoing flows) introduced possible oopse when dst_alloc returns NULL.
Signed-off-by: Hiroaki SHIMODA <
[email protected]
>
Signed-off-by: David S. Miller <
[email protected]
>
net/xfrm/xfrm_policy.c
patch
|
blob
|
history
diff --git
a/net/xfrm/xfrm_policy.c
b/net/xfrm/xfrm_policy.c
index 8b3ef404c79441bb47e4b15225bf7eb39c0d9501..6459588befc33fc58baa4f341b04f95e7a675bca 100644
(file)
--- a/
net/xfrm/xfrm_policy.c
+++ b/
net/xfrm/xfrm_policy.c
@@
-1340,10
+1340,13
@@
static inline struct xfrm_dst *xfrm_alloc_dst(struct net *net, int family)
default:
BUG();
}
- xdst = dst_alloc(dst_ops)
?: ERR_PTR(-ENOBUFS)
;
+ xdst = dst_alloc(dst_ops);
xfrm_policy_put_afinfo(afinfo);
- xdst->flo.ops = &xfrm_bundle_fc_ops;
+ if (likely(xdst))
+ xdst->flo.ops = &xfrm_bundle_fc_ops;
+ else
+ xdst = ERR_PTR(-ENOBUFS);
return xdst;
}