diff options
author | JP Abgrall <jpa@google.com> | 2012-05-10 13:30:14 -0700 |
---|---|---|
committer | JP Abgrall <jpa@google.com> | 2012-05-10 13:30:14 -0700 |
commit | 00a60d164498aa993ffc53913e4e0d0b245ca8b0 (patch) | |
tree | 9d8fb63d0ecb1910186ebcf73a5e678808e57250 /net | |
parent | 3ac736070c32c828f0bb797ad1015eb723ac1528 (diff) | |
parent | a0e6c2f9f297c760797980d9ccfe2eb00fc5b46d (diff) | |
download | kernel_samsung_aries-00a60d164498aa993ffc53913e4e0d0b245ca8b0.zip kernel_samsung_aries-00a60d164498aa993ffc53913e4e0d0b245ca8b0.tar.gz kernel_samsung_aries-00a60d164498aa993ffc53913e4e0d0b245ca8b0.tar.bz2 |
Merge remote-tracking branch 'common/android-3.0' into android-samsung-30-wip-mergedown
* common/android-3.0:
ipv6: check return value for dst_alloc
net: check return value for dst_alloc
Diffstat (limited to 'net')
-rw-r--r-- | net/ipv6/route.c | 4 | ||||
-rw-r--r-- | net/xfrm/xfrm_policy.c | 10 |
2 files changed, 9 insertions, 5 deletions
diff --git a/net/ipv6/route.c b/net/ipv6/route.c index 8e600f8..7ef5d08 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c @@ -233,7 +233,9 @@ static inline struct rt6_info *ip6_dst_alloc(struct dst_ops *ops, { struct rt6_info *rt = dst_alloc(ops, dev, 0, 0, flags); - memset(&rt->rt6i_table, 0, sizeof(*rt) - sizeof(struct dst_entry)); + if (rt != NULL) + memset(&rt->rt6i_table, 0, + sizeof(*rt) - sizeof(struct dst_entry)); return rt; } diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c index 7803eb6..1b906c3 100644 --- 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; } |