summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2023-02-09 18:00:26 +0100
committerLinus Torvalds <torvalds@linux-foundation.org>2023-02-09 18:00:26 +0100
commit94a1f56db688f134c763a4b2a5926b437f1ab4b9 (patch)
treec9759069701bc5b003257368ea9b94c27383e6b3 /fs
parentMerge tag 'devicetree-fixes-for-6.2-2' of git://git.kernel.org/pub/scm/linux/... (diff)
parentcifs: Fix use-after-free in rdata->read_into_pages() (diff)
downloadlinux-94a1f56db688f134c763a4b2a5926b437f1ab4b9.tar.xz
linux-94a1f56db688f134c763a4b2a5926b437f1ab4b9.zip
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()
Diffstat (limited to 'fs')
-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 22dfc1f8b4f1..b8d1cbadb689 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;
}