From: Aleksandr Aprelkov Date: Wed, 27 Mar 2024 07:10:44 +0000 (+0700) Subject: sunrpc: removed redundant procp check X-Git-Tag: v6.8.12~38 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c684bf624e2f2633a3ae97981cf2b9ba7937f06a;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 b969e505c7b77..bd61e257cda6a 100644 --- a/net/sunrpc/svc.c +++ b/net/sunrpc/svc.c @@ -1263,8 +1263,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);