Offering: HULK hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/IAO0ER
--------------------------------
This reverts commit 9f14fd51e077 ("cifs: Fix pages leak when writedata alloc failed in cifs_write_from_iter()").
In cifs_write_from_iter(), pagevec should not be released when it is not initialized. The release should occur only after the pagevec has been properly initialized. Rolled back the improperly adapted patch first.
Fixes: 9f14fd51e077 ("cifs: Fix pages leak when writedata alloc failed in cifs_write_from_iter()") Signed-off-by: Zizhi Wo wozizhi@huawei.com --- fs/cifs/file.c | 3 --- 1 file changed, 3 deletions(-)
diff --git a/fs/cifs/file.c b/fs/cifs/file.c index dc7175b75c26..d908eba024f0 100644 --- a/fs/cifs/file.c +++ b/fs/cifs/file.c @@ -2988,9 +2988,6 @@ cifs_write_from_iter(loff_t offset, size_t len, struct iov_iter *from, cifs_uncached_writev_complete); if (!wdata) { rc = -ENOMEM; - for (i = 0; i < nr_pages; i++) - put_page(pagevec[i]); - kvfree(pagevec); add_credits_and_wake_if(server, credits, 0); break; }