Linux NFS development
 help / color / mirror / Atom feed
* [PATCH] sunrpc: removed redundant procp check
@ 2024-03-27  7:10 Aleksandr Aprelkov
  2024-03-27 10:09 ` Jeff Layton
  2024-03-27 14:10 ` Chuck Lever
  0 siblings, 2 replies; 3+ messages in thread
From: Aleksandr Aprelkov @ 2024-03-27  7:10 UTC (permalink / raw)
  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,
	linux-nfs, netdev, linux-kernel, lvc-project

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 <aaprelkov@usergate.com>
---
 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);
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] sunrpc: removed redundant procp check
  2024-03-27  7:10 [PATCH] sunrpc: removed redundant procp check Aleksandr Aprelkov
@ 2024-03-27 10:09 ` Jeff Layton
  2024-03-27 14:10 ` Chuck Lever
  1 sibling, 0 replies; 3+ messages in thread
From: Jeff Layton @ 2024-03-27 10:09 UTC (permalink / raw)
  To: Aleksandr Aprelkov, Trond Myklebust
  Cc: Anna Schumaker, Chuck Lever, Neil Brown, Olga Kornievskaia,
	Dai Ngo, Tom Talpey, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, linux-nfs, netdev, linux-kernel,
	lvc-project

On Wed, 2024-03-27 at 14:10 +0700, Aleksandr Aprelkov wrote:
> 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 <aaprelkov@usergate.com>
> ---
>  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);

This should probably go in via Chuck's tree.

Reviewed-by: Jeff Layton <jlayton@kernel.org>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] sunrpc: removed redundant procp check
  2024-03-27  7:10 [PATCH] sunrpc: removed redundant procp check Aleksandr Aprelkov
  2024-03-27 10:09 ` Jeff Layton
@ 2024-03-27 14:10 ` Chuck Lever
  1 sibling, 0 replies; 3+ messages in thread
From: Chuck Lever @ 2024-03-27 14:10 UTC (permalink / raw)
  To: Aleksandr Aprelkov
  Cc: Trond Myklebust, Anna Schumaker, Jeff Layton, Neil Brown,
	Olga Kornievskaia, Dai Ngo, Tom Talpey, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, linux-nfs, netdev,
	linux-kernel, lvc-project

On Wed, Mar 27, 2024 at 02:10:44PM +0700, Aleksandr Aprelkov wrote:
> 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 <aaprelkov@usergate.com>

Applied to nfsd-next. Thanks!


> ---
>  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);
> -- 
> 2.34.1
> 

-- 
Chuck Lever

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-03-27 14:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-27  7:10 [PATCH] sunrpc: removed redundant procp check Aleksandr Aprelkov
2024-03-27 10:09 ` Jeff Layton
2024-03-27 14:10 ` Chuck Lever

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox