2014-07-10 11:32:47

by Maxim Patlasov

[permalink] [raw]
Subject: [PATCH] fuse: release temporary page if fuse_writepage_locked() failed

tmp_page to be freed if fuse_write_file_get() returns NULL.

Signed-off-by: Maxim Patlasov <[email protected]>
---
fs/fuse/file.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/fs/fuse/file.c b/fs/fuse/file.c
index 3a47aa2..a18baa4 100644
--- a/fs/fuse/file.c
+++ b/fs/fuse/file.c
@@ -1679,7 +1679,7 @@ static int fuse_writepage_locked(struct page *page)
error = -EIO;
req->ff = fuse_write_file_get(fc, fi);
if (!req->ff)
- goto err_free;
+ goto err_nofile;

fuse_write_fill(req, req->ff, page_offset(page), 0);

@@ -1707,6 +1707,8 @@ static int fuse_writepage_locked(struct page *page)

return 0;

+err_nofile:
+ __free_page(tmp_page);
err_free:
fuse_request_free(req);
err: