Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 70452dcb authored by Erik Hugne's avatar Erik Hugne Committed by David S. Miller
Browse files

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
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -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)