aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2023-02-09 09:00:26 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2023-02-09 09:00:26 -0800
commit94a1f56db688f134c763a4b2a5926b437f1ab4b9 (patch)
treec9759069701bc5b003257368ea9b94c27383e6b3
parent0983f6bf2bfc0789b51ddf7315f644ff4da50acb (diff)
parentaa5465aeca3c66fecdf7efcf554aed79b4c4b211 (diff)
downloadlinux-94a1f56db688f134c763a4b2a5926b437f1ab4b9.tar.gz
Merge tag '6.2-rc8-smb3-client-fix' of git://git.samba.org/sfrench/cifs-2.6
Pull cifx fix from Steve French: "Small fix for use after free" * tag '6.2-rc8-smb3-client-fix' of git://git.samba.org/sfrench/cifs-2.6: cifs: Fix use-after-free in rdata->read_into_pages()
-rw-r--r--fs/cifs/file.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/cifs/file.c b/fs/cifs/file.c
index 22dfc1f8b4f12f..b8d1cbadb68977 100644
--- a/fs/cifs/file.c
+++ b/fs/cifs/file.c
@@ -3889,7 +3889,7 @@ uncached_fill_pages(struct TCP_Server_Info *server,
rdata->got_bytes += result;
}
- return rdata->got_bytes > 0 && result != -ECONNABORTED ?
+ return result != -ECONNABORTED && rdata->got_bytes > 0 ?
rdata->got_bytes : result;
}
@@ -4665,7 +4665,7 @@ readpages_fill_pages(struct TCP_Server_Info *server,
rdata->got_bytes += result;
}
- return rdata->got_bytes > 0 && result != -ECONNABORTED ?
+ return result != -ECONNABORTED && rdata->got_bytes > 0 ?
rdata->got_bytes : result;
}