Thread (10 messages) 10 messages, 2 authors, 2021-06-30

[PATCH 1/3] hfs: add missing clean-up in hfs_fill_super

From: Desmond Cheong Zhi Xi <hidden>
Date: 2021-06-29 14:49:03
Also in: linux-fsdevel, lkml
Subsystem: filesystems (vfs and infrastructure), hfs filesystem, the rest · Maintainers: Alexander Viro, Christian Brauner, Viacheslav Dubeyko, John Paul Adrian Glaubitz, Yangtao Li, Linus Torvalds

On exiting hfs_fill_super, the file descriptor used in hfs_find_init
should be passed to hfs_find_exit to be cleaned up, and to release the
lock held on the btree.

The call to hfs_find_exit is missing from this error path, so we add
it in to release resources.

Signed-off-by: Desmond Cheong Zhi Xi <redacted>
---
 fs/hfs/super.c | 1 +
 1 file changed, 1 insertion(+)
diff --git a/fs/hfs/super.c b/fs/hfs/super.c
index 44d07c9e3a7f..48340b77eb36 100644
--- a/fs/hfs/super.c
+++ b/fs/hfs/super.c
@@ -419,6 +419,7 @@ static int hfs_fill_super(struct super_block *sb, void *data, int silent)
 	res = hfs_cat_find_brec(sb, HFS_ROOT_CNID, &fd);
 	if (!res) {
 		if (fd.entrylength > sizeof(rec) || fd.entrylength < 0) {
+			hfs_find_exit(&fd);
 			res =  -EIO;
 			goto bail;
 		}
-- 
2.25.1

_______________________________________________
Linux-kernel-mentees mailing list
Linux-kernel-mentees@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help