diff options
-rw-r--r-- | net/sunrpc/xprtrdma/transport.c | 16 | ||||
-rw-r--r-- | net/sunrpc/xprtsock.c | 16 |
2 files changed, 20 insertions, 12 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) | |||
212 | static void | 212 | static void |
213 | xprt_rdma_free_addresses(struct rpc_xprt *xprt) | 213 | xprt_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 | ||
223 | static void | 227 | static void |
diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c index b9b94f49c620..30e7ac243a90 100644 --- a/net/sunrpc/xprtsock.c +++ b/net/sunrpc/xprtsock.c | |||
@@ -398,12 +398,16 @@ static void xs_format_ipv6_peer_addresses(struct rpc_xprt *xprt, | |||
398 | 398 | ||
399 | static void xs_free_peer_addresses(struct rpc_xprt *xprt) | 399 | static void xs_free_peer_addresses(struct rpc_xprt *xprt) |
400 | { | 400 | { |
401 | kfree(xprt->address_strings[RPC_DISPLAY_ADDR]); | 401 | unsigned int i; |
402 | kfree(xprt->address_strings[RPC_DISPLAY_PORT]); | 402 | |
403 | kfree(xprt->address_strings[RPC_DISPLAY_ALL]); | 403 | for (i = 0; i < RPC_DISPLAY_MAX; i++) |
404 | kfree(xprt->address_strings[RPC_DISPLAY_HEX_ADDR]); | 404 | switch (i) { |
405 | kfree(xprt->address_strings[RPC_DISPLAY_HEX_PORT]); | 405 | case RPC_DISPLAY_PROTO: |
406 | kfree(xprt->address_strings[RPC_DISPLAY_UNIVERSAL_ADDR]); | 406 | case RPC_DISPLAY_NETID: |
407 | continue; | ||
408 | default: | ||
409 | kfree(xprt->address_strings[i]); | ||
410 | } | ||
407 | } | 411 | } |
408 | 412 | ||
409 | #define XS_SENDMSG_FLAGS (MSG_DONTWAIT | MSG_NOSIGNAL) | 413 | #define XS_SENDMSG_FLAGS (MSG_DONTWAIT | MSG_NOSIGNAL) |