From: Aleksandr Aprelkov Date: Wed, 27 Mar 2024 07:10:44 +0000 (+0700) Subject: sunrpc: removed redundant procp check X-Git-Tag: v5.15.161~228 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=33feac2e8df3a299258ee37d8f32c165b4937fe7;p=thirdparty%2Fkernel%2Fstable.git sunrpc: removed redundant procp check [ Upstream commit a576f36971ab4097b6aa76433532aa1fb5ee2d3b ] 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 Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever Signed-off-by: Sasha Levin --- diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c index 9177b243a949d..8d5897ed2816f 100644 --- a/net/sunrpc/svc.c +++ b/net/sunrpc/svc.c @@ -1238,8 +1238,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);