sunrpc: removed redundant procp check
Subsystems (4)
PATCH 1/1 sunrpc: removed redundant procp check
since vs_proc pointer is dereferenced before getting it's address there's no need to check for NULL.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
Fixes 8e5b67731d08 ("SUNRPC: Add a callback to initialise server requests")
Signed-off-by Aleksandr Aprelkov <[email protected]>
--- net/sunrpc/svc.c | 2 -- 1 file changed, 2 deletions(-)
net/sunrpc/svc.c +0 -2
@@ -1265,8 +1265,6 @@ svc_generic_init_request(struct svc_rqst *rqstp,if (rqstp->rq_proc >= versp->vs_nproc) goto err_bad_proc; rqstp->rq_procinfo = procp = &versp->vs_proc[rqstp->rq_proc]; -if (!procp) - goto err_bad_proc;/* Initialize storage for argp and resp */ memset (rqstp->rq_argp,0 , procp->pc_argzero);
Signature · 1 line
2.34.1
Quoted 16 lines · Aleksandr Aprelkov
since
vs_procpointer is dereferenced before getting it's address there's no need to check for NULL.Found by Linux Verification Center (linuxtesting.org) with SVACE.
Fixes 8e5b67731d08 ("SUNRPC: Add a callback to initialise server requests")Signed-off-by Aleksandr Aprelkov <[email protected]>--- net/sunrpc/svc.c | 2 -- 1 file changed, 2 deletions(-)net/sunrpc/svc.c +0
-0
net/sunrpc/svc.c svc_generic_init_request(struct svc_rqst *rqstp, · line 1270
Quoted 8 lines
net/sunrpc/svc.c +0
-2@@ -1265,8 +1265,6 @@ svc_generic_init_request(struct svc_rqst *rqstp,if (rqstp->rq_proc >= versp->vs_nproc) goto err_bad_proc; rqstp->rq_procinfo = procp = &versp->vs_proc[rqstp->rq_proc]; -if (!procp) - goto err_bad_proc;/* Initialize storage for argp and resp */ memset (rqstp->rq_argp,0 , procp->pc_argzero);
This should probably go in via Chuck's tree.
Reviewed-by Jeff Layton <[email protected]>
Chuck Lever
AppliedQuoted 7 lines · Aleksandr Aprelkov
since
vs_procpointer is dereferenced before getting it's address there's no need to check for NULL.Found by Linux Verification Center (linuxtesting.org) with SVACE.
Fixes 8e5b67731d08 ("SUNRPC: Add a callback to initialise server requests")Signed-off-by Aleksandr Aprelkov <[email protected]>
Applied to nfsd-next. Thanks!
Quoted 20 lines
--- net/sunrpc/svc.c | 2 -- 1 file changed, 2 deletions(-)net/sunrpc/svc.c +0
-2@@ -1265,8 +1265,6 @@ svc_generic_init_request(struct svc_rqst *rqstp,if (rqstp->rq_proc >= versp->vs_nproc) goto err_bad_proc; rqstp->rq_procinfo = procp = &versp->vs_proc[rqstp->rq_proc]; -if (!procp) - goto err_bad_proc;/* Initialize storage for argp and resp */ memset (rqstp->rq_argp,0 , procp->pc_argzero);Signature · 1 line
2.34.1
Signature · 1 line
Chuck Lever