nfsd: zero out pointers after putting nfsd_files on COPY setup error

[ Upstream commit 1f0001d43d ]

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>
This commit is contained in:
Jeff Layton 2023-01-17 14:38:30 -05:00 коммит произвёл Greg Kroah-Hartman
Родитель 8c5f6c6992
Коммит bde7dcd778
1 изменённых файлов: 2 добавлений и 0 удалений

Просмотреть файл

@ -1088,8 +1088,10 @@ out:
return status;
out_put_dst:
nfsd_file_put(*dst);
*dst = NULL;
out_put_src:
nfsd_file_put(*src);
*src = NULL;
goto out;
}