diff options
Diffstat (limited to 'net/ipv6/icmp.c')
-rw-r--r-- | net/ipv6/icmp.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/net/ipv6/icmp.c b/net/ipv6/icmp.c index a5e95199585e..2c2b5d51f15c 100644 --- a/net/ipv6/icmp.c +++ b/net/ipv6/icmp.c | |||
@@ -160,8 +160,7 @@ static bool is_ineligible(const struct sk_buff *skb) | |||
160 | tp = skb_header_pointer(skb, | 160 | tp = skb_header_pointer(skb, |
161 | ptr+offsetof(struct icmp6hdr, icmp6_type), | 161 | ptr+offsetof(struct icmp6hdr, icmp6_type), |
162 | sizeof(_type), &_type); | 162 | sizeof(_type), &_type); |
163 | if (tp == NULL || | 163 | if (!tp || !(*tp & ICMPV6_INFOMSG_MASK)) |
164 | !(*tp & ICMPV6_INFOMSG_MASK)) | ||
165 | return true; | 164 | return true; |
166 | } | 165 | } |
167 | return false; | 166 | return false; |
@@ -231,7 +230,7 @@ static bool opt_unrec(struct sk_buff *skb, __u32 offset) | |||
231 | 230 | ||
232 | offset += skb_network_offset(skb); | 231 | offset += skb_network_offset(skb); |
233 | op = skb_header_pointer(skb, offset, sizeof(_optval), &_optval); | 232 | op = skb_header_pointer(skb, offset, sizeof(_optval), &_optval); |
234 | if (op == NULL) | 233 | if (!op) |
235 | return true; | 234 | return true; |
236 | return (*op & 0xC0) == 0x80; | 235 | return (*op & 0xC0) == 0x80; |
237 | } | 236 | } |
@@ -244,7 +243,7 @@ int icmpv6_push_pending_frames(struct sock *sk, struct flowi6 *fl6, | |||
244 | int err = 0; | 243 | int err = 0; |
245 | 244 | ||
246 | skb = skb_peek(&sk->sk_write_queue); | 245 | skb = skb_peek(&sk->sk_write_queue); |
247 | if (skb == NULL) | 246 | if (!skb) |
248 | goto out; | 247 | goto out; |
249 | 248 | ||
250 | icmp6h = icmp6_hdr(skb); | 249 | icmp6h = icmp6_hdr(skb); |
@@ -479,7 +478,7 @@ static void icmp6_send(struct sk_buff *skb, u8 type, u8 code, __u32 info) | |||
479 | security_skb_classify_flow(skb, flowi6_to_flowi(&fl6)); | 478 | security_skb_classify_flow(skb, flowi6_to_flowi(&fl6)); |
480 | 479 | ||
481 | sk = icmpv6_xmit_lock(net); | 480 | sk = icmpv6_xmit_lock(net); |
482 | if (sk == NULL) | 481 | if (!sk) |
483 | return; | 482 | return; |
484 | sk->sk_mark = mark; | 483 | sk->sk_mark = mark; |
485 | np = inet6_sk(sk); | 484 | np = inet6_sk(sk); |
@@ -582,7 +581,7 @@ static void icmpv6_echo_reply(struct sk_buff *skb) | |||
582 | security_skb_classify_flow(skb, flowi6_to_flowi(&fl6)); | 581 | security_skb_classify_flow(skb, flowi6_to_flowi(&fl6)); |
583 | 582 | ||
584 | sk = icmpv6_xmit_lock(net); | 583 | sk = icmpv6_xmit_lock(net); |
585 | if (sk == NULL) | 584 | if (!sk) |
586 | return; | 585 | return; |
587 | sk->sk_mark = mark; | 586 | sk->sk_mark = mark; |
588 | np = inet6_sk(sk); | 587 | np = inet6_sk(sk); |
@@ -839,7 +838,7 @@ static int __net_init icmpv6_sk_init(struct net *net) | |||
839 | 838 | ||
840 | net->ipv6.icmp_sk = | 839 | net->ipv6.icmp_sk = |
841 | kzalloc(nr_cpu_ids * sizeof(struct sock *), GFP_KERNEL); | 840 | kzalloc(nr_cpu_ids * sizeof(struct sock *), GFP_KERNEL); |
842 | if (net->ipv6.icmp_sk == NULL) | 841 | if (!net->ipv6.icmp_sk) |
843 | return -ENOMEM; | 842 | return -ENOMEM; |
844 | 843 | ||
845 | for_each_possible_cpu(i) { | 844 | for_each_possible_cpu(i) { |