aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc/xprtsock.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/sunrpc/xprtsock.c')
-rw-r--r--net/sunrpc/xprtsock.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c
index 015f29edb619..b3f40b8dbcba 100644
--- a/net/sunrpc/xprtsock.c
+++ b/net/sunrpc/xprtsock.c
@@ -279,10 +279,14 @@ static void xs_format_peer_addresses(struct rpc_xprt *xprt)
279 } 279 }
280 xprt->address_strings[RPC_DISPLAY_PORT] = buf; 280 xprt->address_strings[RPC_DISPLAY_PORT] = buf;
281 281
282 if (xprt->prot == IPPROTO_UDP) 282 buf = kzalloc(8, GFP_KERNEL);
283 xprt->address_strings[RPC_DISPLAY_PROTO] = "udp"; 283 if (buf) {
284 else 284 if (xprt->prot == IPPROTO_UDP)
285 xprt->address_strings[RPC_DISPLAY_PROTO] = "tcp"; 285 snprintf(buf, 8, "udp");
286 else
287 snprintf(buf, 8, "tcp");
288 }
289 xprt->address_strings[RPC_DISPLAY_PROTO] = buf;
286 290
287 buf = kzalloc(48, GFP_KERNEL); 291 buf = kzalloc(48, GFP_KERNEL);
288 if (buf) { 292 if (buf) {
@@ -296,9 +300,10 @@ static void xs_format_peer_addresses(struct rpc_xprt *xprt)
296 300
297static void xs_free_peer_addresses(struct rpc_xprt *xprt) 301static void xs_free_peer_addresses(struct rpc_xprt *xprt)
298{ 302{
299 kfree(xprt->address_strings[RPC_DISPLAY_ADDR]); 303 int i;
300 kfree(xprt->address_strings[RPC_DISPLAY_PORT]); 304
301 kfree(xprt->address_strings[RPC_DISPLAY_ALL]); 305 for (i = 0; i < RPC_DISPLAY_MAX; i++)
306 kfree(xprt->address_strings[i]);
302} 307}
303 308
304#define XS_SENDMSG_FLAGS (MSG_DONTWAIT | MSG_NOSIGNAL) 309#define XS_SENDMSG_FLAGS (MSG_DONTWAIT | MSG_NOSIGNAL)