History

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.

Yang Li committed 5 years ago

Commit 458032f1 parent 8847ecc1 file · +1 −1Browse files

Unified · Split

net/sunrpc/auth_gss/svcauth_gss.c+1−1
@@ -781,7 +781,7 @@ gss_write_verf(struct svc_rqst *rqstp, struct gss_ctx *ctx_id, u32 seq) · 780 unmodified lines
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;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t