aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc/svc_xprt.c
diff options
context:
space:
mode:
authorNeil Brown <neilb@suse.de>2010-02-26 17:33:40 -0500
committerJ. Bruce Fields <bfields@citi.umich.edu>2010-02-26 17:42:46 -0500
commitab1b18f70a007ea6caeb007d269abb75b131a410 (patch)
tree95b895bb6da102507baff9606b20ef038f7a55e3 /net/sunrpc/svc_xprt.c
parent58255a4e3ce506b43bb14d5579006731a981490d (diff)
sunrpc: remove unnecessary svc_xprt_put
The 'struct svc_deferred_req's on the xpt_deferred queue do not own a reference to the owning xprt. This is seen in svc_revisit which is where things are added to this queue. dr->xprt is set to NULL and the reference to the xprt it put. So when this list is cleaned up in svc_delete_xprt, we mustn't put the reference. Also, replace the 'for' with a 'while' which is arguably simpler and more likely to compile efficiently. Cc: Tom Tucker <tom@opengridcomputing.com> Signed-off-by: NeilBrown <neilb@suse.de> Cc: stable@kernel.org Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Diffstat (limited to 'net/sunrpc/svc_xprt.c')
-rw-r--r--net/sunrpc/svc_xprt.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/net/sunrpc/svc_xprt.c b/net/sunrpc/svc_xprt.c
index d7ec5caf998c..09838300dac4 100644
--- a/net/sunrpc/svc_xprt.c
+++ b/net/sunrpc/svc_xprt.c
@@ -896,11 +896,8 @@ void svc_delete_xprt(struct svc_xprt *xprt)
896 if (test_bit(XPT_TEMP, &xprt->xpt_flags)) 896 if (test_bit(XPT_TEMP, &xprt->xpt_flags))
897 serv->sv_tmpcnt--; 897 serv->sv_tmpcnt--;
898 898
899 for (dr = svc_deferred_dequeue(xprt); dr; 899 while ((dr = svc_deferred_dequeue(xprt)) != NULL)
900 dr = svc_deferred_dequeue(xprt)) {
901 svc_xprt_put(xprt);
902 kfree(dr); 900 kfree(dr);
903 }
904 901
905 svc_xprt_put(xprt); 902 svc_xprt_put(xprt);
906 spin_unlock_bh(&serv->sv_lock); 903 spin_unlock_bh(&serv->sv_lock);