]> git.ipfire.org Git - thirdparty/kmod.git/commitdiff
tools/modinfo: exit non-zero on module not found
authorDave Reisner <d@falconindy.com>
Fri, 6 Jan 2012 03:56:53 +0000 (22:56 -0500)
committerLucas De Marchi <lucas.demarchi@profusion.mobi>
Fri, 6 Jan 2012 04:32:28 +0000 (02:32 -0200)
tools/kmod-modinfo.c

index b6af26fbadbaa93b1c961125760ec431baaf8b6c..8506193735c7fe071c132bbf959265d7839f45b5 100644 (file)
@@ -279,6 +279,12 @@ static int modinfo_alias_do(struct kmod_ctx *ctx, const char *alias)
                LOG("Module alias %s not found.\n", alias);
                return err;
        }
+
+       if (list == NULL) {
+               LOG("Module %s not found.\n", alias);
+               return -ENOENT;
+       }
+
        kmod_list_foreach(l, list) {
                struct kmod_module *mod = kmod_module_get_module(l);
                int r = modinfo_do(mod);