diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2012-01-31 16:45:26 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-02-01 02:52:48 -0500 |
commit | 5b11b2e4bdef20e839d90dce96c5bbeafaf9616c (patch) | |
tree | 8dfac0cc9ff403c906993a3d0d493575a50aa297 /net/ipv6/xfrm6_output.c | |
parent | a8afca032998850ec63e83d555cdcf0eb5680cd6 (diff) |
xfrm6: remove unneeded NULL check in __xfrm6_output()
We don't check for NULL consistently in __xfrm6_output(). If "x" were
NULL here it would lead to an OOPs later. I asked Steffen Klassert
about this and he suggested that we remove the NULL check.
On 10/29/11, Steffen Klassert <steffen.klassert@secunet.com> wrote:
>> net/ipv6/xfrm6_output.c
>> 148
>> 149 if ((x && x->props.mode == XFRM_MODE_TUNNEL) &&
>> ^
>
> x can't be null here. It would be a bug if __xfrm6_output() is called
> without a xfrm_state attached to the skb. I think we can just remove
> this null check.
Cc: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/xfrm6_output.c')
-rw-r--r-- | net/ipv6/xfrm6_output.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ipv6/xfrm6_output.c b/net/ipv6/xfrm6_output.c index 4eeff89c1aaa..8755a3079d0f 100644 --- a/net/ipv6/xfrm6_output.c +++ b/net/ipv6/xfrm6_output.c | |||
@@ -146,7 +146,7 @@ static int __xfrm6_output(struct sk_buff *skb) | |||
146 | return -EMSGSIZE; | 146 | return -EMSGSIZE; |
147 | } | 147 | } |
148 | 148 | ||
149 | if ((x && x->props.mode == XFRM_MODE_TUNNEL) && | 149 | if (x->props.mode == XFRM_MODE_TUNNEL && |
150 | ((skb->len > mtu && !skb_is_gso(skb)) || | 150 | ((skb->len > mtu && !skb_is_gso(skb)) || |
151 | dst_allfrag(skb_dst(skb)))) { | 151 | dst_allfrag(skb_dst(skb)))) { |
152 | return ip6_fragment(skb, x->outer_mode->afinfo->output_finish); | 152 | return ip6_fragment(skb, x->outer_mode->afinfo->output_finish); |