SUNRPC: Fix a module reference leak in svc_handle_xprt
authorTrond Myklebust <trond.myklebust@primarydata.com>
Sun, 18 May 2014 18:05:22 +0000 (14:05 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 7 Jul 2014 01:54:14 +0000 (18:54 -0700)
commit c789102c20bbbdda6831a273e046715be9d6af79 upstream.

If the accept() call fails, we need to put the module reference.

Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/sunrpc/svc_xprt.c

index 80a6640f329bab991859e032fda658a871e65ca5..b9aad4723a9d3aa3270b0fd546e055489932d30f 100644 (file)
@@ -730,6 +730,8 @@ static int svc_handle_xprt(struct svc_rqst *rqstp, struct svc_xprt *xprt)
                newxpt = xprt->xpt_ops->xpo_accept(xprt);
                if (newxpt)
                        svc_add_new_temp_xprt(serv, newxpt);
+               else
+                       module_put(xprt->xpt_class->xcl_owner);
        } else if (xprt->xpt_ops->xpo_has_wspace(xprt)) {
                /* XPT_DATA|XPT_DEFERRED case: */
                dprintk("svc: server %p, pool %u, transport %p, inuse=%d\n",