You've already forked linux-rockchip
mirror of
https://github.com/armbian/linux-rockchip.git
synced 2026-01-06 11:08:10 -08:00
SUNRPC: svc_tcp_sendmsg() should handle errors from xdr_alloc_bvec()
[ Upstream commitb056fa0708] The allocation is done with GFP_KERNEL, but it could still fail in a low memory situation. Fixes:4a85a6a332("SUNRPC: Handle TCP socket sends with kernel_sendpage() again") Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
9a45e08636
commit
b3c00be2ff
@@ -1091,7 +1091,9 @@ static int svc_tcp_sendmsg(struct socket *sock, struct msghdr *msg,
|
||||
int flags, ret;
|
||||
|
||||
*sentp = 0;
|
||||
xdr_alloc_bvec(xdr, GFP_KERNEL);
|
||||
ret = xdr_alloc_bvec(xdr, GFP_KERNEL);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
msg->msg_flags = MSG_MORE;
|
||||
ret = kernel_sendmsg(sock, msg, &rm, 1, rm.iov_len);
|
||||
|
||||
Reference in New Issue
Block a user