When kmod_module_new_from_lookup() resolves to an alias, `err` will be
set to a positive value from the lookup function. Do not return a
positive value to follow the behavior when it matches a module name
and the documentation.
Reviewed-by: Luis Chamberlain <mcgrof@kernel.org>
finish:
- DBG(ctx, "lookup %s=%d, list=%p\n", alias, err, *list);
- return err;
+ DBG(ctx, "lookup %s matches=%d, list=%p\n", alias, err, *list);
+ return err > 0 ? 0 : err;
fail:
DBG(ctx, "Failed to lookup %s\n", alias);
kmod_module_unref_list(*list);