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

From: Maxim Patlasov
Date: Thu Jul 10 2014 - 07:32:52 EST


tmp_page to be freed if fuse_write_file_get() returns NULL.

Signed-off-by: Maxim Patlasov <mpatlasov@xxxxxxxxxxxxx>
---
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:

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/