NFSv4.2: Fix READ_PLUS smatch warnings
authorAnna Schumaker <Anna.Schumaker@Netapp.com>
Wed, 24 May 2023 21:27:08 +0000 (17:27 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 13 Sep 2023 07:42:48 +0000 (09:42 +0200)
commit5c47974263e8d3a6bbee987148bfba07f5cf803d
tree5262aed9cdfdc32b3bd6e409dc792c0e128fec42
parent886959f425b6a936a30b82a297ae3aecb3b8230f
NFSv4.2: Fix READ_PLUS smatch warnings

[ Upstream commit bb05a617f06b7a882e19c4f475b8e37f14d9ceac ]

Smatch reports:
  fs/nfs/nfs42xdr.c:1131 decode_read_plus() warn: missing error code? 'status'

Which Dan suggests to fix by doing a hardcoded "return 0" from the
"if (segments == 0)" check.

Additionally, smatch reports that the "status = -EIO" assignment is not
used. This patch addresses both these issues.

Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <error27@gmail.com>
Closes: https://lore.kernel.org/r/202305222209.6l5VM2lL-lkp@intel.com/
Fixes: d3b00a802c845 ("NFS: Replace the READ_PLUS decoding code")
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/nfs/nfs42xdr.c