--- zzzz-none-000/linux-2.6.39.4/net/ipv6/tcp_ipv6.c 2011-08-03 19:43:28.000000000 +0000 +++ puma6-atom-6490-729/linux-2.6.39.4/net/ipv6/tcp_ipv6.c 2021-11-10 13:38:18.000000000 +0000 @@ -150,7 +150,7 @@ if (fl6.flowlabel&IPV6_FLOWLABEL_MASK) { struct ip6_flowlabel *flowlabel; flowlabel = fl6_sock_lookup(sk, fl6.flowlabel); - if (flowlabel == NULL) + if (!flowlabel) return -EINVAL; ipv6_addr_copy(&usin->sin6_addr, &flowlabel->dst); fl6_sock_release(flowlabel); @@ -261,7 +261,7 @@ goto failure; } - if (saddr == NULL) { + if (!saddr) { saddr = &fl6.saddr; ipv6_addr_copy(&np->rcv_saddr, saddr); } @@ -343,7 +343,7 @@ sk = inet6_lookup(net, &tcp_hashinfo, &hdr->daddr, th->dest, &hdr->saddr, th->source, skb->dev->ifindex); - if (sk == NULL) { + if (!sk) { ICMP6_INC_STATS_BH(net, __in6_dev_get(skb->dev), ICMP6_MIB_INERRORS); return; @@ -387,7 +387,7 @@ /* icmp should have updated the destination cache entry */ dst = __sk_dst_check(sk, np->dst_cookie); - if (dst == NULL) { + if (!dst) { struct inet_sock *inet = inet_sk(sk); struct flowi6 fl6; @@ -439,7 +439,7 @@ /* ICMPs are not backlogged, hence we cannot get * an established socket here. */ - WARN_ON(req->sk != NULL); + WARN_ON(req->sk); if (seq != tcp_rsk(req)->snt_isn) { NET_INC_STATS_BH(net, LINUX_MIB_OUTOFWINDOWICMPS); @@ -556,7 +556,7 @@ struct tcp_sock *tp = tcp_sk(sk); int i; - BUG_ON(tp == NULL); + BUG_ON(!tp); if (!tp->md5sig_info || !tp->md5sig_info->entries6) return NULL; @@ -604,7 +604,7 @@ } sk_nocaps_add(sk, NETIF_F_GSO_MASK); } - if (tcp_alloc_md5sig_pool(sk) == NULL) { + if (!tcp_alloc_md5sig_pool(sk)) { kfree(newkey); return -ENOMEM; } @@ -1009,7 +1009,7 @@ buff = alloc_skb(MAX_HEADER + sizeof(struct ipv6hdr) + tot_len, GFP_ATOMIC); - if (buff == NULL) + if (!buff) return; skb_reserve(buff, MAX_HEADER + sizeof(struct ipv6hdr) + tot_len); @@ -1205,7 +1205,7 @@ goto drop; req = inet6_reqsk_alloc(&tcp6_request_sock_ops); - if (req == NULL) + if (!req) goto drop; #ifdef CONFIG_TCP_MD5SIG @@ -1221,7 +1221,7 @@ tmp_opt.saw_tstamp && !tp->rx_opt.cookie_out_never && (sysctl_tcp_cookie_size > 0 || - (tp->cookie_values != NULL && + (tp->cookie_values && tp->cookie_values->cookie_desired > 0))) { u8 *c; u32 *d; @@ -1307,8 +1307,8 @@ */ if (tmp_opt.saw_tstamp && tcp_death_row.sysctl_tw_recycle && - (dst = inet6_csk_route_req(sk, req)) != NULL && - (peer = rt6_get_peer((struct rt6_info *)dst)) != NULL && + (dst = inet6_csk_route_req(sk, req)) && + (peer = rt6_get_peer((struct rt6_info *)dst)) && ipv6_addr_equal((struct in6_addr *)peer->daddr.addr.a6, &treq->rmt_addr)) { inet_peer_refcheck(peer); @@ -1382,7 +1382,7 @@ newsk = tcp_v4_syn_recv_sock(sk, skb, req, dst); - if (newsk == NULL) + if (!newsk) return NULL; newtcp6sk = (struct tcp6_sock *)newsk; @@ -1439,7 +1439,7 @@ } newsk = tcp_create_openreq_child(sk, req, skb); - if (newsk == NULL) + if (!newsk) goto out_nonewsk; /* @@ -1477,7 +1477,7 @@ /* Clone pktoptions received with SYN */ newnp->pktoptions = NULL; - if (treq->pktopts != NULL) { + if (treq->pktopts) { newnp->pktoptions = skb_clone(treq->pktopts, GFP_ATOMIC); kfree_skb(treq->pktopts); treq->pktopts = NULL; @@ -1515,14 +1515,15 @@ #ifdef CONFIG_TCP_MD5SIG /* Copy over the MD5 key from the original socket */ - if ((key = tcp_v6_md5_do_lookup(sk, &newnp->daddr)) != NULL) { + key = tcp_v6_md5_do_lookup(sk, &newnp->daddr); + if (key) { /* We're using one, so create a matching key * on the newsk structure. If we fail to get * memory, then we end up not copying the key * across. Shucks. */ char *newkey = kmemdup(key->key, key->keylen, GFP_ATOMIC); - if (newkey != NULL) + if (newkey) tcp_v6_md5_do_add(newsk, &newnp->daddr, newkey, key->keylen); } @@ -1828,7 +1829,7 @@ sk2 = inet6_lookup_listener(dev_net(skb->dev), &tcp_hashinfo, &ipv6_hdr(skb)->daddr, ntohs(th->dest), inet6_iif(skb)); - if (sk2 != NULL) { + if (sk2) { struct inet_timewait_sock *tw = inet_twsk(sk); inet_twsk_deschedule(tw, &tcp_death_row); inet_twsk_put(tw); @@ -1994,7 +1995,7 @@ tp->cookie_values = kzalloc(sizeof(*tp->cookie_values), sk->sk_allocation); - if (tp->cookie_values != NULL) + if (tp->cookie_values) kref_init(&tp->cookie_values->kref); } /* Presumed zeroed, in order of appearance: