summaryrefslogtreecommitdiffstats
path: root/fs/cifs/file.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2019-05-31 22:49:50 +0200
committerLinus Torvalds <torvalds@linux-foundation.org>2019-05-31 22:49:50 +0200
commit41e7231fab9d76e906b6d8abe09c44c7b9656d33 (patch)
treef250117954733a4827e5dd9b313c52314895da91 /fs/cifs/file.c
parentMerge branch 'next-fixes-for-5.2-rc' of git://git.kernel.org/pub/scm/linux/ke... (diff)
parentCIFS: cifs_read_allocate_pages: don't iterate through whole page array on ENOMEM (diff)
downloadlinux-41e7231fab9d76e906b6d8abe09c44c7b9656d33.tar.xz
linux-41e7231fab9d76e906b6d8abe09c44c7b9656d33.zip
Merge tag 'v5.2-rc2-smb3-fixes' of git://git.samba.org/sfrench/cifs-2.6
Pull cifs fixes from Steve French: "Four small smb3 fixes, one for stable" * tag 'v5.2-rc2-smb3-fixes' of git://git.samba.org/sfrench/cifs-2.6: CIFS: cifs_read_allocate_pages: don't iterate through whole page array on ENOMEM dfs_cache: fix a wrong use of kfree in flush_cache_ent() fs/cifs/smb2pdu.c: fix buffer free in SMB2_ioctl_free cifs: fix memory leak of pneg_inbuf on -EOPNOTSUPP ioctl case
Diffstat (limited to 'fs/cifs/file.c')
-rw-r--r--fs/cifs/file.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/cifs/file.c b/fs/cifs/file.c
index ce9a5be11df5..06e27ac6d82c 100644
--- a/fs/cifs/file.c
+++ b/fs/cifs/file.c
@@ -3216,7 +3216,9 @@ cifs_read_allocate_pages(struct cifs_readdata *rdata, unsigned int nr_pages)
}
if (rc) {
- for (i = 0; i < nr_pages; i++) {
+ unsigned int nr_page_failed = i;
+
+ for (i = 0; i < nr_page_failed; i++) {
put_page(rdata->pages[i]);
rdata->pages[i] = NULL;
}