Clean up the error handling paths in fuse_writepages(). No functional changes added. Signed-off-by: Joanne Koong <joannelkoong@xxxxxxxxx> --- fs/fuse/file.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/fs/fuse/file.c b/fs/fuse/file.c index 1ae58f93884e..8a9b6e8dbd1b 100644 --- a/fs/fuse/file.c +++ b/fs/fuse/file.c @@ -2352,9 +2352,8 @@ static int fuse_writepages(struct address_space *mapping, struct fuse_fill_wb_data data; int err; - err = -EIO; if (fuse_is_bad(inode)) - goto out; + return -EIO; if (wbc->sync_mode == WB_SYNC_NONE && fc->num_background >= fc->congestion_threshold) @@ -2364,12 +2363,11 @@ static int fuse_writepages(struct address_space *mapping, data.wpa = NULL; data.ff = NULL; - err = -ENOMEM; data.orig_pages = kcalloc(fc->max_pages, sizeof(struct page *), GFP_NOFS); if (!data.orig_pages) - goto out; + return -ENOMEM; err = write_cache_pages(mapping, wbc, fuse_writepages_fill, &data); if (data.wpa) { @@ -2380,7 +2378,6 @@ static int fuse_writepages(struct address_space *mapping, fuse_file_put(data.ff, false); kfree(data.orig_pages); -out: return err; } -- 2.43.5