When normalizing alias names (or if we don't know if it's an alias or
modname), use alias_normalize() instead of modname_normalize(). The
difference is that alias names can contain dashes withing brackets, and
those should not be changed to underscores.
Most of the places using underscores() function might be converted to
alias_normalize(), but this is not done now.
return -ENOSYS;
}
- modname_normalize(given_alias, alias, NULL);
+ if (alias_normalize(given_alias, alias, NULL) < 0)
+ return -EINVAL;
/* Aliases from config file override all the others */
err = kmod_lookup_alias_from_config(ctx, alias, list);
if (ctx == NULL || options == NULL)
return -ENOENT;
- modname_normalize(given_alias, alias, NULL);
+ if (alias_normalize(given_alias, alias, NULL) < 0)
+ return -EINVAL;
+
err = kmod_module_new_from_lookup(ctx, alias, &modules);
if (err >= 0) {