summaryrefslogtreecommitdiff
path: root/net/sunrpc/auth_gss
diff options
context:
space:
mode:
authorYang Li <yang.lee@linux.alibaba.com>2021-09-10 12:33:24 +0300
committerJ. Bruce Fields <bfields@redhat.com>2021-09-23 23:05:24 +0300
commit458032fcfa91c8714859b1f01b9ac7dccea5d6cd (patch)
treeb6930bdc43b392687db725917296b815fceb696f /net/sunrpc/auth_gss
parent8847ecc9274a14114385d1cb4030326baa0766eb (diff)
downloadlinux-458032fcfa91c8714859b1f01b9ac7dccea5d6cd.tar.xz
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: Abaci Robot <abaci@linux.alibaba.com> Signed-off-by: Yang Li <yang.lee@linux.alibaba.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'net/sunrpc/auth_gss')
-rw-r--r--net/sunrpc/auth_gss/svcauth_gss.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/sunrpc/auth_gss/svcauth_gss.c b/net/sunrpc/auth_gss/svcauth_gss.c
index 3e776e3dff91..7dba6a9c213a 100644
--- a/net/sunrpc/auth_gss/svcauth_gss.c
+++ b/net/sunrpc/auth_gss/svcauth_gss.c
@@ -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;