Documentation says kmod_module_new_from_lookup() returns < 0 on error
and 0 otherwise. There are bugs in libkmod however making it return
a positive value in some situations, that need to be fixed. However
it's best to check for the error explicitly like is done in the rest
of the library to avoid this kind of issues.
Reviewed-by: Luis Chamberlain <mcgrof@kernel.org>
exit(EXIT_FAILURE);
err = kmod_module_new_from_lookup(ctx, "fake-builtin", &list);
- if (err != 0) {
+ if (err < 0) {
ERR("could not create module from lookup: %s\n", strerror(-err));
exit(EXIT_FAILURE);
}