]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
NFSD fixing possible null pointer derefering in copy offload
authorOlga Kornievskaia <olga.kornievskaia@gmail.com>
Wed, 4 Dec 2019 20:13:54 +0000 (15:13 -0500)
committerJ. Bruce Fields <bfields@redhat.com>
Sat, 7 Dec 2019 16:28:46 +0000 (11:28 -0500)
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>
fs/nfsd/nfs4proc.c

index 38c0aeda500e4471ff43a2965a37825f5c469cdd..4798667af647cf958f58e8b07084f1b3f8ac5aeb 100644 (file)
@@ -1298,7 +1298,8 @@ nfsd4_copy(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
 out:
        return status;
 out_err:
-       cleanup_async_copy(async_copy);
+       if (async_copy)
+               cleanup_async_copy(async_copy);
        goto out;
 }