nfsd4: fix double free in nfsd4_do_async_copy()
authorDan Carpenter <dan.carpenter@oracle.com>
Mon, 13 Jan 2020 13:23:07 +0000 (16:23 +0300)
committerJ. Bruce Fields <bfields@redhat.com>
Thu, 6 Feb 2020 16:22:55 +0000 (11:22 -0500)
This frees "copy->nf_src" before and again after the goto.

Fixes: ce0887ac96d3 ("NFSD add nfs4 inter ssc to nfsd4_copy")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Olga Kornievskaia <kolga@netapp.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
fs/nfsd/nfs4proc.c

index e4ddaf87493ae4b961b8f10f48dac7c9973046ab..0e75f7fb5fec0a363e1c1230f6fb731de9b26737 100644 (file)
@@ -1469,7 +1469,6 @@ static int nfsd4_do_async_copy(void *data)
                copy->nf_src->nf_file = nfs42_ssc_open(copy->ss_mnt, &copy->c_fh,
                                              &copy->stateid);
                if (IS_ERR(copy->nf_src->nf_file)) {
-                       kfree(copy->nf_src);
                        copy->nfserr = nfserr_offload_denied;
                        nfsd4_interssc_disconnect(copy->ss_mnt);
                        goto do_callback;