Patchwork rpcsvc: safe mem_put of req in nfs_rpcsvc_submit_vectors

login
register
Submitter Anand Avati
Date 2011-03-01 20:19:59
Message ID <20110301201959.GA28501@dev.gluster.com>
Download mbox | patch
Permalink /patch/6319/
State Accepted
Headers show

Comments

Anand Avati - 2011-03-01 20:19:59
Signed-off-by: Anand Avati <avati@gluster.com>
---
 xlators/nfs/lib/src/rpcsvc.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

Patch

diff --git a/xlators/nfs/lib/src/rpcsvc.c b/xlators/nfs/lib/src/rpcsvc.c
index cd9733e..515e873 100644
--- a/xlators/nfs/lib/src/rpcsvc.c
+++ b/xlators/nfs/lib/src/rpcsvc.c
@@ -1783,6 +1783,7 @@  nfs_rpcsvc_submit_vectors (rpcsvc_request_t *req)
         struct iobuf            *replyiob = NULL;
         struct iovec            recordhdr = {0, };
         rpcsvc_txbuf_t          *rpctxb = NULL;
+        void                    *rxpool = NULL;
 
         if ((!req) || (!req->conn))
                 return -1;
@@ -1818,11 +1819,13 @@  disconnect_exit:
          * response to the ref that is performed on the conn when a request is
          * handed to the RPC program.
          */
+        rxpool = req->conn->rxpool;
+
         nfs_rpcsvc_conn_unref (req->conn);
         if (ret == -1)
                 iobuf_unref (replyiob);
 
-        mem_put (req->conn->rxpool, req);
+        mem_put (rxpool, req);
         return ret;
 }