mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-21 08:19:28 +00:00
tipc: fix a memleak when sending data
This fixes a regression bug caused by:
067608e9d0
("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>
This commit is contained in:
parent
51ba0ed175
commit
70452dcb6d
1 changed files with 4 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue