NFSv4.x: Fix a refcount leak in nfs_callback_up_net
authorTrond Myklebust <trond.myklebust@primarydata.com>
Mon, 29 Aug 2016 15:15:36 +0000 (11:15 -0400)
committerTrond Myklebust <trond.myklebust@primarydata.com>
Tue, 30 Aug 2016 13:26:57 +0000 (09:26 -0400)
On error, the callers expect us to return without bumping
nn->cb_users[].

Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Cc: stable@vger.kernel.org # v3.7+
fs/nfs/callback.c

index a7f2e6e..52a2831 100644 (file)
@@ -275,6 +275,7 @@ static int nfs_callback_up_net(int minorversion, struct svc_serv *serv,
 err_socks:
        svc_rpcb_cleanup(serv, net);
 err_bind:
+       nn->cb_users[minorversion]--;
        dprintk("NFS: Couldn't create callback socket: err = %d; "
                        "net = %p\n", ret, net);
        return ret;