Skip to content

Commit

Permalink
fuse: release temporary page if fuse_writepage_locked() failed
Browse files Browse the repository at this point in the history
tmp_page to be freed if fuse_write_file_get() returns NULL.

Signed-off-by: Maxim Patlasov <mpatlasov@parallels.com>
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
  • Loading branch information
Maxim Patlasov authored and Miklos Szeredi committed Jul 14, 2014
1 parent 4237ba4 commit 27f1b36
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion fs/fuse/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -1722,7 +1722,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);

Expand Down Expand Up @@ -1750,6 +1750,8 @@ static int fuse_writepage_locked(struct page *page)

return 0;

err_nofile:
__free_page(tmp_page);
err_free:
fuse_request_free(req);
err:
Expand Down

0 comments on commit 27f1b36

Please sign in to comment.