diff --git a/fs/unicode/utf8-norm.c b/fs/unicode/utf8-norm.c index 768f8ab448b8..0437eda38991 100644 --- a/fs/unicode/utf8-norm.c +++ b/fs/unicode/utf8-norm.c @@ -422,6 +422,10 @@ int utf8ncursor(struct utf8cursor *u8c, const struct unicode_map *um, { if (!s) return -1; + + if (IS_ERR(um)) + return -1; + u8c->um = um; u8c->n = n; u8c->s = s;