From: Trond Myklebust Date: Fri, 24 Jun 2016 14:55:47 +0000 (-0400) Subject: SUNRPC: lock the socket while detaching it X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=069c225b88202c84bdbe18bed9e30e77924fdd0a;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git SUNRPC: lock the socket while detaching it Prevent callbacks from triggering while we're detaching the socket. Signed-off-by: Trond Myklebust Signed-off-by: J. Bruce Fields --- diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c index dadfec66dbd8..abe2da602fb8 100644 --- a/net/sunrpc/svcsock.c +++ b/net/sunrpc/svcsock.c @@ -1611,9 +1611,12 @@ static void svc_sock_detach(struct svc_xprt *xprt) dprintk("svc: svc_sock_detach(%p)\n", svsk); /* put back the old socket callbacks */ + lock_sock(sk); sk->sk_state_change = svsk->sk_ostate; sk->sk_data_ready = svsk->sk_odata; sk->sk_write_space = svsk->sk_owspace; + sk->sk_user_data = NULL; + release_sock(sk); wq = sk_sleep(sk); if (sunrpc_waitqueue_active(wq))