Merge branch ‘udp-a-few-fixes’ [Linux 5.0]

This Linux kernel change "Merge branch ‘udp-a-few-fixes’" is included in the Linux 5.0 release. This change is authored by David S. Miller <davem [at] davemloft.net> on Fri Feb 22 16:05:12 2019 -0800. The commit for this change in Linux stable tree is 40e8f0b (patch). Other info about this change: Merge: 6ff7b06 92b9536

Merge branch 'udp-a-few-fixes'

Paolo Abeni says:

====================
udp: a few fixes

This series includes some UDP-related fixlet. All this stuff has been
pointed out by the sparse tool. The first two patches are just annotation
related, while the last 2 cover some very unlikely races.
====================

Signed-off-by: David S. Miller <[email protected]>

There is no are 0 lines of Linux source code added/deleted in this change. Code changes to Linux kernel are as follows.

 net/ipv4/udp.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index 5c3cd5d..372fdc5 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -562,10 +562,12 @@ static int __udp4_lib_err_encap_no_sk(struct sk_buff *skb, u32 info)

    for (i = 0; i < MAX_IPTUN_ENCAP_OPS; i++) {
        int (*handler)(struct sk_buff *skb, u32 info);
+       const struct ip_tunnel_encap_ops *encap;

-       if (!iptun_encaps[i])
+       encap = rcu_dereference(iptun_encaps[i]);
+       if (!encap)
            continue;
-       handler = rcu_dereference(iptun_encaps[i]->err_handler);
+       handler = encap->err_handler;
        if (handler && !handler(skb, info))
            return 0;
    }

Leave a Reply

Your email address will not be published. Required fields are marked *