From patchwork Wed Mar 27 07:10:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aleksandr Aprelkov X-Patchwork-Id: 13605735 X-Patchwork-Delegate: kuba@kernel.org Received: from mx2.usergate.com (mx2.usergate.com [46.229.79.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6B7B12C1A2; Wed, 27 Mar 2024 07:41:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.229.79.1 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711525299; cv=none; b=uRP+NNLYWM9mUnOc0AhK8hRMi3lp1op4ylicnuvWp7w/BEzdPNE51Z6rsvXKUAZaqiXQ6IKLzP+mUZIDE2u7dW/E2xVjiyQWqKqxt+iW3u/4OmebwSNB98Qxaeza1fN7VpIoz9fFYcZqBAjTEm67i2sMRAj3qDFwhuEqbSlACwQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711525299; c=relaxed/simple; bh=WEZbm4Q05nrIoUPa93HT1baOMt9IyxBknCAiOcLJqc4=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=tSviREG1O217XV08EvjgjTPV/nILzmrgNtRMU2K6dYsBUmu/syNwWuMp09GRcKb8Rx6EewFh4SGzY9y7NduGzpmcMn1L2KZFihPdDF5V/GD5ZqwQwdbTmFgelWIzzR8g91cTO8wfI4Olb2obxK2rhiAymJiQf1hg8l6flZwRnAQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=usergate.com; spf=pass smtp.mailfrom=usergate.com; arc=none smtp.client-ip=46.229.79.1 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=usergate.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=usergate.com Received: from mail.usergate.com[192.168.90.36] by mx2.usergate.com with ESMTP id DFB3A364686B451CA267CD06A10D08A9; Wed, 27 Mar 2024 14:11:02 +0700 From: Aleksandr Aprelkov To: Trond Myklebust CC: Aleksandr Aprelkov ,Anna Schumaker ,Chuck Lever ,Jeff Layton ,Neil Brown ,Olga Kornievskaia ,Dai Ngo ,Tom Talpey ,"David S. Miller" ,Eric Dumazet ,Jakub Kicinski ,Paolo Abeni ,,,, Subject: [PATCH] sunrpc: removed redundant procp check Date: Wed, 27 Mar 2024 14:10:44 +0700 Message-ID: <20240327071044.365284-1-aaprelkov@usergate.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: ESLSRV-EXCH-01.esafeline.com (192.168.90.36) To nsk02-mbx01.esafeline.com (10.10.1.35) X-Message-Id: BCE3BE4874C140DD802FC89A20BCC59A X-MailFileId: CE9AECCD9CD84540A70607A1150C868E X-Patchwork-Delegate: kuba@kernel.org 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 --- net/sunrpc/svc.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c index b33e429336fb..2b4b1276d4e8 100644 --- a/net/sunrpc/svc.c +++ b/net/sunrpc/svc.c @@ -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);