Commit 70452dcb authored by Erik Hugne's avatar Erik Hugne Committed by 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: default avatarErik Hugne <erik.hugne@ericsson.com>
Signed-off-by: default avatarJon Maloy <jon.maloy@ericsson.com>
Acked-by: default avatarYing Xue <ying.xue@windriver.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 51ba0ed1
......@@ -784,8 +784,9 @@ static int tipc_sendmsg(struct kiocb *iocb, struct socket *sock,
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 @@ static int tipc_send_stream(struct kiocb *iocb, struct socket *sock,
break;
}
rc = tipc_wait_for_sndpkt(sock, &timeo);
if (rc)
kfree_skb_list(buf);
} while (!rc);
exit:
if (iocb)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment