diff options
author | Olga Kornievskaia <olga.kornievskaia@gmail.com> | 2019-12-04 21:13:54 +0100 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2019-12-09 17:44:07 +0100 |
commit | 2e577f0faca4640348c398cb85d60a1eedac4b1e (patch) | |
tree | 4fda061103734437d5b08986f58498a2eb64db96 /fs/nfsd | |
parent | NFSD fix nfserro errno mismatch (diff) | |
download | linux-2e577f0faca4640348c398cb85d60a1eedac4b1e.tar.xz linux-2e577f0faca4640348c398cb85d60a1eedac4b1e.zip |
NFSD fixing possible null pointer derefering in copy offload
Static checker revealed possible error path leading to possible
NULL pointer dereferencing.
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Fixes: e0639dc5805a: ("NFSD introduce async copy feature")
Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd')
-rw-r--r-- | fs/nfsd/nfs4proc.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c index d012f0894fab..d33c39c18cdd 100644 --- a/fs/nfsd/nfs4proc.c +++ b/fs/nfsd/nfs4proc.c @@ -1446,7 +1446,8 @@ static void cleanup_async_copy(struct nfsd4_copy *copy) { nfs4_free_copy_state(copy); nfsd_file_put(copy->nf_dst); - nfsd_file_put(copy->nf_src); + if (copy->cp_intra) + nfsd_file_put(copy->nf_src); spin_lock(©->cp_clp->async_lock); list_del(©->copies); spin_unlock(©->cp_clp->async_lock); |