Skip to content

Commit 89e4354

Browse files
dhowellsPaolo Abeni
authored andcommitted
rxrpc: Fix error check on ->alloc_txbuf()
rxrpc_alloc_*_txbuf() and ->alloc_txbuf() return NULL to indicate no memory, but rxrpc_send_data() uses IS_ERR(). Fix rxrpc_send_data() to check for NULL only and set -ENOMEM if it sees that. Fixes: 49489bb ("rxrpc: Do zerocopy using MSG_SPLICE_PAGES and page frags") Signed-off-by: David Howells <dhowells@redhat.com> Reported-by: Marc Dionne <marc.dionne@auristor.com> cc: "David S. Miller" <davem@davemloft.net> cc: Eric Dumazet <edumazet@google.com> cc: Jakub Kicinski <kuba@kernel.org> cc: Paolo Abeni <pabeni@redhat.com> cc: linux-afs@lists.infradead.org cc: netdev@vger.kernel.org Signed-off-by: Paolo Abeni <pabeni@redhat.com>
1 parent 6b25364 commit 89e4354

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

net/rxrpc/sendmsg.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -349,8 +349,8 @@ static int rxrpc_send_data(struct rxrpc_sock *rx,
349349
*/
350350
remain = more ? INT_MAX : msg_data_left(msg);
351351
txb = call->conn->security->alloc_txbuf(call, remain, sk->sk_allocation);
352-
if (IS_ERR(txb)) {
353-
ret = PTR_ERR(txb);
352+
if (!txb) {
353+
ret = -ENOMEM;
354354
goto maybe_error;
355355
}
356356
}

0 commit comments

Comments
 (0)