aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc/xprtrdma
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2008-01-14 12:32:20 -0500
committerTrond Myklebust <Trond.Myklebust@netapp.com>2008-01-30 02:06:08 -0500
commit33e01dc7f578813cda074ceaeaf68b0f3ffcc393 (patch)
treea1a84d98ae900b8960bd59742f1e2b767e7cb4f8 /net/sunrpc/xprtrdma
parentc0e07cb68db353c0ffbb0f82401cf6d79c253aed (diff)
SUNRPC: Clean up functions that free address_strings array
Clean up: document the rule (kfree) and the exceptions (RPC_DISPLAY_PROTO and RPC_DISPLAY_NETID) when freeing the objects in a transport's address_strings array. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'net/sunrpc/xprtrdma')
-rw-r--r--net/sunrpc/xprtrdma/transport.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/net/sunrpc/xprtrdma/transport.c b/net/sunrpc/xprtrdma/transport.c
index d1389afc8342..02c522c17de5 100644
--- a/net/sunrpc/xprtrdma/transport.c
+++ b/net/sunrpc/xprtrdma/transport.c
@@ -212,12 +212,16 @@ xprt_rdma_format_addresses(struct rpc_xprt *xprt)
212static void 212static void
213xprt_rdma_free_addresses(struct rpc_xprt *xprt) 213xprt_rdma_free_addresses(struct rpc_xprt *xprt)
214{ 214{
215 kfree(xprt->address_strings[RPC_DISPLAY_ADDR]); 215 unsigned int i;
216 kfree(xprt->address_strings[RPC_DISPLAY_PORT]); 216
217 kfree(xprt->address_strings[RPC_DISPLAY_ALL]); 217 for (i = 0; i < RPC_DISPLAY_MAX; i++)
218 kfree(xprt->address_strings[RPC_DISPLAY_HEX_ADDR]); 218 switch (i) {
219 kfree(xprt->address_strings[RPC_DISPLAY_HEX_PORT]); 219 case RPC_DISPLAY_PROTO:
220 kfree(xprt->address_strings[RPC_DISPLAY_UNIVERSAL_ADDR]); 220 case RPC_DISPLAY_NETID:
221 continue;
222 default:
223 kfree(xprt->address_strings[i]);
224 }
221} 225}
222 226
223static void 227static void