Commit 1191edbe authored by Jeff Layton's avatar Jeff Layton Committed by sanglipeng
Browse files

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

stable inclusion
from stable-v5.10.173
commit 759f6a72bc5aaa44634adbac26e14fac709a3c8b
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I8BFR3

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=759f6a72bc5aaa44634adbac26e14fac709a3c8b



--------------------------------

[ Upstream commit 1f0001d4 ]

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: default avatarJeff Layton <jlayton@kernel.org>
Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarsanglipeng <sanglipeng1@jd.com>
parent e86d6666
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment