sunrpc: fix peername failed on closed listener
[sfrench/cifs-2.6.git] / net / sunrpc / svc_xprt.c
index 2c58b75a236f1db692ca8c368546381f1ea510ac..810ffe8a636b5f9197e6a9c21a59641f7151b0ac 100644 (file)
@@ -699,7 +699,8 @@ int svc_recv(struct svc_rqst *rqstp, long timeout)
        spin_unlock_bh(&pool->sp_lock);
 
        len = 0;
-       if (test_bit(XPT_LISTENER, &xprt->xpt_flags)) {
+       if (test_bit(XPT_LISTENER, &xprt->xpt_flags) &&
+           !test_bit(XPT_CLOSE, &xprt->xpt_flags)) {
                struct svc_xprt *newxpt;
                newxpt = xprt->xpt_ops->xpo_accept(xprt);
                if (newxpt) {