]> git.baikalelectronics.ru Git - kernel.git/commit
nfsd: zero out pointers after putting nfsd_files on COPY setup error
authorJeff Layton <jlayton@kernel.org>
Tue, 17 Jan 2023 19:38:30 +0000 (14:38 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 11 Mar 2023 15:43:58 +0000 (16:43 +0100)
commitda702f262098f35f4f5c9f70358cd1b84bf86e83
tree6a8118bf4fd1f45bc70657fc1db0b8ae3498eeb3
parenta5668f23676aa4916d6e1d5a8775ac686ae7afcf
nfsd: zero out pointers after putting nfsd_files on COPY setup error

[ Upstream commit 1f0001d43d0c0ac2a19a34a914f6595ad97cbc1d ]

At first, I thought this might be a source of nfsd_file overputs, but
the current callers seem to avoid an extra put when nfsd4_verify_copy
returns an error.

Still, it's "bad form" to leave the pointers filled out when we don't
have a reference to them anymore, and that might lead to bugs later.
Zero them out as a defensive coding measure.

Signed-off-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/nfsd/nfs4proc.c