Thread (2 messages) 2 messages, 2 authors, 2021-10-12

Re: [PATCH 10/11] unicode: Add utf8-data module

From: Christoph Hellwig <hch@lst.de>
Date: 2021-10-12 12:49:09
Also in: linux-f2fs-devel, linux-fsdevel
Subsystem: filesystems (vfs and infrastructure), the rest, unicode subsystem · Maintainers: Alexander Viro, Christian Brauner, Linus Torvalds, Gabriel Krisman Bertazi

Possibly related (same subject, not in this thread)

[fullquote deleted]

On Tue, Oct 12, 2021 at 08:25:23AM -0300, Gabriel Krisman Bertazi wrote:
quoted
@@ -187,6 +207,7 @@ EXPORT_SYMBOL(utf8_load);
 
 void utf8_unload(struct unicode_map *um)
 {
+	symbol_put(utf8_data_table);
This triggers a BUG_ON if the symbol isn't loaded/loadable,
i.e. ext4_fill_super fails early.  I'm not sure how to fix it, though.
Does this fix it?
diff --git a/fs/unicode/utf8-core.c b/fs/unicode/utf8-core.c
index 38ca824f10158..67aaadc3ab072 100644
--- a/fs/unicode/utf8-core.c
+++ b/fs/unicode/utf8-core.c
@@ -207,8 +207,10 @@ EXPORT_SYMBOL(utf8_load);
 
 void utf8_unload(struct unicode_map *um)
 {
-	symbol_put(utf8_data_table);
-	kfree(um);
+	if (um) {
+		symbol_put(utf8_data_table);
+		kfree(um);
+	}
 }
 EXPORT_SYMBOL(utf8_unload);
 
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help