Skip to content

Commit 732c4a9

Browse files
committed
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse
Pull fuse fixes from Miklos Szeredi: "Two bugfixes, both bound for -stable" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse: fuse: break infinite loop in fuse_fill_write_pages() cuse: fix memory leak
2 parents 4be460d + 3ca8138 commit 732c4a9

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

fs/fuse/cuse.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -549,6 +549,8 @@ static int cuse_channel_release(struct inode *inode, struct file *file)
549549
unregister_chrdev_region(cc->cdev->dev, 1);
550550
cdev_del(cc->cdev);
551551
}
552+
/* Base reference is now owned by "fud" */
553+
fuse_conn_put(&cc->fc);
552554

553555
rc = fuse_dev_release(inode, file); /* puts the base reference */
554556

fs/fuse/file.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1049,6 +1049,7 @@ static ssize_t fuse_fill_write_pages(struct fuse_req *req,
10491049
tmp = iov_iter_copy_from_user_atomic(page, ii, offset, bytes);
10501050
flush_dcache_page(page);
10511051

1052+
iov_iter_advance(ii, tmp);
10521053
if (!tmp) {
10531054
unlock_page(page);
10541055
page_cache_release(page);
@@ -1061,7 +1062,6 @@ static ssize_t fuse_fill_write_pages(struct fuse_req *req,
10611062
req->page_descs[req->num_pages].length = tmp;
10621063
req->num_pages++;
10631064

1064-
iov_iter_advance(ii, tmp);
10651065
count += tmp;
10661066
pos += tmp;
10671067
offset += tmp;

0 commit comments

Comments
 (0)