Skip to content

Commit 66588ab

Browse files
olgakorn1Trond Myklebust
authored andcommitted
NFSv4.2 fix kfree in __nfs42_copy_file_range
This is triggering problems with static analysis with Coverity Reported-by: Colin King <[email protected]> Signed-off-by: Olga Kornievskaia <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
1 parent 843aa17 commit 66588ab

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

fs/nfs/nfs4file.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,8 @@ static ssize_t __nfs4_copy_file_range(struct file *file_in, loff_t pos_in,
177177
ret = nfs42_proc_copy(file_in, pos_in, file_out, pos_out, count,
178178
nss, cnrs, sync);
179179
out:
180-
kfree(cn_resp);
180+
if (!nfs42_files_from_same_server(file_in, file_out))
181+
kfree(cn_resp);
181182
if (ret == -EAGAIN)
182183
goto retry;
183184
return ret;

0 commit comments

Comments
 (0)