提交 70452dcb 编写于 作者: E Erik Hugne 提交者: David S. Miller

tipc: fix a memleak when sending data

This fixes a regression bug caused by:
067608e9 ("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: NErik Hugne <erik.hugne@ericsson.com>
Signed-off-by: NJon Maloy <jon.maloy@ericsson.com>
Acked-by: NYing Xue <ying.xue@windriver.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 51ba0ed1
...@@ -784,8 +784,9 @@ static int tipc_sendmsg(struct kiocb *iocb, struct socket *sock, ...@@ -784,8 +784,9 @@ static int tipc_sendmsg(struct kiocb *iocb, struct socket *sock,
break; break;
rc = tipc_wait_for_sndmsg(sock, &timeo); rc = tipc_wait_for_sndmsg(sock, &timeo);
if (rc)
kfree_skb_list(buf);
} while (!rc); } while (!rc);
exit: exit:
if (iocb) if (iocb)
release_sock(sk); release_sock(sk);
...@@ -898,6 +899,8 @@ static int tipc_send_stream(struct kiocb *iocb, struct socket *sock, ...@@ -898,6 +899,8 @@ static int tipc_send_stream(struct kiocb *iocb, struct socket *sock,
break; break;
} }
rc = tipc_wait_for_sndpkt(sock, &timeo); rc = tipc_wait_for_sndpkt(sock, &timeo);
if (rc)
kfree_skb_list(buf);
} while (!rc); } while (!rc);
exit: exit:
if (iocb) if (iocb)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册