Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

SUNRPC: Fix a module reference leak in svc_handle_xprt

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

Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Cc: stable@vger.kernel.org
Signed-off-by: J. Bruce Fields <bfields@redhat.com>

authored by

Trond Myklebust and committed by
J. Bruce Fields
c789102c 16e4d93f

+2
+2
net/sunrpc/svc_xprt.c
··· 730 730 newxpt = xprt->xpt_ops->xpo_accept(xprt); 731 731 if (newxpt) 732 732 svc_add_new_temp_xprt(serv, newxpt); 733 + else 734 + module_put(xprt->xpt_class->xcl_owner); 733 735 } else if (xprt->xpt_ops->xpo_has_wspace(xprt)) { 734 736 /* XPT_DATA|XPT_DEFERRED case: */ 735 737 dprintk("svc: server %p, pool %u, transport %p, inuse=%d\n",