diff options
author | David Howells <[email protected]> | 2024-03-12 23:37:18 +0000 |
---|---|---|
committer | Paolo Abeni <[email protected]> | 2024-03-14 13:09:53 +0100 |
commit | 89e4354110ca64bf4949cca83b55149bc80733bc (patch) | |
tree | 6a9e4f74e7e9eb3d454c285e7fcf4b0581159680 | |
parent | 6b2536462fd48b49563aef0555517cb91047c5f5 (diff) |
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: 49489bb03a50 ("rxrpc: Do zerocopy using MSG_SPLICE_PAGES and page frags")
Signed-off-by: David Howells <[email protected]>
Reported-by: Marc Dionne <[email protected]>
cc: "David S. Miller" <[email protected]>
cc: Eric Dumazet <[email protected]>
cc: Jakub Kicinski <[email protected]>
cc: Paolo Abeni <[email protected]>
cc: [email protected]
cc: [email protected]
Signed-off-by: Paolo Abeni <[email protected]>
-rw-r--r-- | net/rxrpc/sendmsg.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/rxrpc/sendmsg.c b/net/rxrpc/sendmsg.c index 6f765768c49c..894b8fa68e5e 100644 --- a/net/rxrpc/sendmsg.c +++ b/net/rxrpc/sendmsg.c @@ -349,8 +349,8 @@ reload: */ remain = more ? INT_MAX : msg_data_left(msg); txb = call->conn->security->alloc_txbuf(call, remain, sk->sk_allocation); - if (IS_ERR(txb)) { - ret = PTR_ERR(txb); + if (!txb) { + ret = -ENOMEM; goto maybe_error; } } |