diff options
author | Erik Hugne <erik.hugne@ericsson.com> | 2014-07-06 20:38:50 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-07-08 19:10:01 -0400 |
commit | 70452dcb6d401349fbd6db55dfab112fb44639be (patch) | |
tree | feca55d75afa146edabe504c04f1c0dea921e69f /net/tipc/socket.c | |
parent | 51ba0ed17514f9f7cf63a4be21092e8f2d8c558e (diff) |
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 <erik.hugne@ericsson.com>
Signed-off-by: Jon Maloy <jon.maloy@ericsson.com>
Acked-by: Ying Xue <ying.xue@windriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc/socket.c')
-rw-r--r-- | net/tipc/socket.c | 5 |
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: | |||
784 | break; | 784 | break; |
785 | 785 | ||
786 | rc = tipc_wait_for_sndmsg(sock, &timeo); | 786 | rc = tipc_wait_for_sndmsg(sock, &timeo); |
787 | if (rc) | ||
788 | kfree_skb_list(buf); | ||
787 | } while (!rc); | 789 | } while (!rc); |
788 | |||
789 | exit: | 790 | exit: |
790 | if (iocb) | 791 | if (iocb) |
791 | release_sock(sk); | 792 | release_sock(sk); |
@@ -898,6 +899,8 @@ next: | |||
898 | break; | 899 | break; |
899 | } | 900 | } |
900 | rc = tipc_wait_for_sndpkt(sock, &timeo); | 901 | rc = tipc_wait_for_sndpkt(sock, &timeo); |
902 | if (rc) | ||
903 | kfree_skb_list(buf); | ||
901 | } while (!rc); | 904 | } while (!rc); |
902 | exit: | 905 | exit: |
903 | if (iocb) | 906 | if (iocb) |