Skip to content

Commit 458032f

Browse files
Yang LiJ. Bruce Fields
authored andcommitted
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 <[email protected]> Signed-off-by: Yang Li <[email protected]> Signed-off-by: J. Bruce Fields <[email protected]>
1 parent 8847ecc commit 458032f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/sunrpc/auth_gss/svcauth_gss.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -781,7 +781,7 @@ gss_write_verf(struct svc_rqst *rqstp, struct gss_ctx *ctx_id, u32 seq)
781781
svc_putnl(rqstp->rq_res.head, RPC_AUTH_GSS);
782782
xdr_seq = kmalloc(4, GFP_KERNEL);
783783
if (!xdr_seq)
784-
return -1;
784+
return -ENOMEM;
785785
*xdr_seq = htonl(seq);
786786

787787
iov.iov_base = xdr_seq;

0 commit comments

Comments
 (0)