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

Commit aab94830 authored by David Howells's avatar David Howells
Browse files

RxRPC: Don't call skb_add_data() if there's no data to copy



Don't call skb_add_data() in rxrpc_send_data() if there's no data to copy and
also skip the calculations associated with it in such a case.

Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
parent 3af6878e
Loading
Loading
Loading
Loading
+19 −19
Original line number Diff line number Diff line
@@ -549,8 +549,6 @@ static int rxrpc_send_data(struct kiocb *iocb,
	if (len > iov_iter_count(&msg->msg_iter))
		len = iov_iter_count(&msg->msg_iter);
	do {
		int copy;

		if (!skb) {
			size_t size, chunk, max, space;

@@ -616,7 +614,8 @@ static int rxrpc_send_data(struct kiocb *iocb,
		sp = rxrpc_skb(skb);

		/* append next segment of data to the current buffer */
		copy = skb_tailroom(skb);
		if (len > 0) {
			int copy = skb_tailroom(skb);
			ASSERTCMP(copy, >, 0);
			if (copy > len)
				copy = len;
@@ -633,6 +632,7 @@ static int rxrpc_send_data(struct kiocb *iocb,
			copied += copy;

			len -= copy;
		}

		/* check for the far side aborting the call or a network error
		 * occurring */