From: Andreas Schultz <aschultz(a)tpip.net>
Date: Mon, 13 Feb 2017 16:36:18 +0100
+ if (gtp->sk0) {
+ udp_sk(gtp->sk0)->encap_type = 0;
+ rcu_assign_sk_user_data(gtp->sk0, NULL);
+ sock_put(gtp->sk0);
}
This does "sock_put(NULL);" because you are assigning gtp->sk0 to
NULL before the sock_put() call. So you are leaking the socket,
at best.
You need to load the socket pointer into a local variable in order
to do this correctly.