VisionFive2 Linux kernel

StarFive Tech Linux Kernel for VisionFive (JH7110) boards (mirror)

More than 9999 Commits   30 Branches   50 Tags
author: Chao Yu <chao@kernel.org> 2023-06-29 09:41:02 +0800 committer: Greg Kroah-Hartman <gregkh@linuxfoundation.org> 2023-07-19 16:36:45 +0200 commit: 0dc1f2b88b6ef0fdc467e377c542c1d68196ce07 parent: dfaa428d137d61cc66f61bc3ba47c096df4c8f2b
Commit Summary:
f2fs: fix error path handling in truncate_dnode()
Diffstat:
1 file changed, 3 insertions, 1 deletion
diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
index 834c6f099c95..6bdb1bed29ec 100644
--- a/fs/f2fs/node.c
+++ b/fs/f2fs/node.c
@@ -943,8 +943,10 @@ static int truncate_dnode(struct dnode_of_data *dn)
 	dn->ofs_in_node = 0;
 	f2fs_truncate_data_blocks(dn);
 	err = truncate_node(dn);
-	if (err)
+	if (err) {
+		f2fs_put_page(page, 1);
 		return err;
+	}
 
 	return 1;
 }