aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc/socket.c
diff options
context:
space:
mode:
authorErik Hugne <[email protected]>2014-07-07 00:38:50 +0000
committerDavid S. Miller <[email protected]>2014-07-08 23:10:01 +0000
commit70452dcb6d401349fbd6db55dfab112fb44639be (patch)
treefeca55d75afa146edabe504c04f1c0dea921e69f /net/tipc/socket.c
parentdefxx: Fix issues with debug printk calls (diff)
downloadkernel-70452dcb6d401349fbd6db55dfab112fb44639be.tar.gz
kernel-70452dcb6d401349fbd6db55dfab112fb44639be.zip
tipc: fix a memleak when sending data
This fixes a regression bug caused by: 067608e9d019d6477fd45dd948e81af0e5bf599f ("tipc: introduce direct iovec to buffer chain fragmentation function") If data is sent on a nonblocking socket and the destination link is congested, the buffer chain is leaked. We fix this by freeing the chain in this case. Signed-off-by: Erik Hugne <[email protected]> Signed-off-by: Jon Maloy <[email protected]> Acked-by: Ying Xue <[email protected]> Signed-off-by: David S. Miller <[email protected]>
Diffstat (limited to 'net/tipc/socket.c')
-rw-r--r--net/tipc/socket.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/net/tipc/socket.c b/net/tipc/socket.c
index ede78b144dcf..8c5600cfcc3e 100644
--- a/net/tipc/socket.c
+++ b/net/tipc/socket.c
@@ -784,8 +784,9 @@ new_mtu:
break;
rc = tipc_wait_for_sndmsg(sock, &timeo);
+ if (rc)
+ kfree_skb_list(buf);
} while (!rc);
-
exit:
if (iocb)
release_sock(sk);
@@ -898,6 +899,8 @@ next:
break;
}
rc = tipc_wait_for_sndpkt(sock, &timeo);
+ if (rc)
+ kfree_skb_list(buf);
} while (!rc);
exit:
if (iocb)