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:
2015de5
)
net: check return value for dst_alloc
author
Madalin Bucur
<
[email protected]
>
Mon, 26 Sep 2011 07:04:36 +0000
(07:04 +0000)
committer
David S. Miller
<
[email protected]
>
Tue, 27 Sep 2011 19:32:06 +0000
(15:32 -0400)
return value of dst_alloc must be checked before use
Signed-off-by: Madalin Bucur <
[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 94fdcc7f103044d97dfe52c5405f8bbf52872a1a..552df27dcf53d3388fb2eb9ab3ba7a31c7ffcd64 100644
(file)
--- a/
net/xfrm/xfrm_policy.c
+++ b/
net/xfrm/xfrm_policy.c
@@
-1349,14
+1349,16
@@
static inline struct xfrm_dst *xfrm_alloc_dst(struct net *net, int family)
BUG();
}
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;
- else
+
}
else
xdst = ERR_PTR(-ENOBUFS);
+ xfrm_policy_put_afinfo(afinfo);
+
return xdst;
}