From 5f85a133f8e4c2c97f90062e4055dbe2efd76325 Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Thu, 5 Jan 2012 22:56:53 -0500 Subject: [PATCH] tools/modinfo: exit non-zero on module not found --- tools/kmod-modinfo.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/kmod-modinfo.c b/tools/kmod-modinfo.c index b6af26fb..85061937 100644 --- a/tools/kmod-modinfo.c +++ b/tools/kmod-modinfo.c @@ -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); -- 2.47.2