Commit 458032fc authored by Yang Li's avatar Yang Li Committed by J. Bruce Fields

UNRPC: Return specific error code on kmalloc failure

Although the callers of this function only care about whether the
return value is null or not, we should still give a rigorous
error code.

Smatch tool warning:
net/sunrpc/auth_gss/svcauth_gss.c:784 gss_write_verf() warn: returning
-1 instead of -ENOMEM is sloppy

No functional change, just more standardized.
Reported-by: default avatarAbaci Robot <abaci@linux.alibaba.com>
Signed-off-by: default avatarYang Li <yang.lee@linux.alibaba.com>
Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
parent 8847ecc9
......@@ -781,7 +781,7 @@ gss_write_verf(struct svc_rqst *rqstp, struct gss_ctx *ctx_id, u32 seq)
svc_putnl(rqstp->rq_res.head, RPC_AUTH_GSS);
xdr_seq = kmalloc(4, GFP_KERNEL);
if (!xdr_seq)
return -1;
return -ENOMEM;
*xdr_seq = htonl(seq);
iov.iov_base = xdr_seq;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment