]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
sunrpc: fix prog selection loop in svc_process_common
authorNeilBrown <neilb@suse.de>
Fri, 27 Sep 2024 06:49:01 +0000 (16:49 +1000)
committerAnna Schumaker <anna.schumaker@oracle.com>
Mon, 30 Sep 2024 19:37:07 +0000 (15:37 -0400)
commit1d498df44e709d9708c0bf666012933bbc7ef1d6
tree8c2c3959a0c018a5e1e553902eebfd662abc808f
parent37578c682cf47bafe29fef29d177b1f38b021db9
sunrpc: fix prog selection loop in svc_process_common

If the rq_prog is not in the list of programs, then we use the last
program in the list and we don't get the expected rpc_prog_unavail error
as the subsequent tests on 'progp' being NULL are ineffective.

We should only assign progp when we find the right program, and we
should initialize it to NULL

Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Fixes: 86ab08beb3f0 ("SUNRPC: replace program list with program array")
Signed-off-by: NeilBrown <neilb@suse.de>
Acked-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Anna Schumaker <anna.schumaker@oracle.com>
net/sunrpc/svc.c