[PATCH 1/2] tools/modinfo: exit non-zero on module not found

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



---
 tools/kmod-modinfo.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/tools/kmod-modinfo.c b/tools/kmod-modinfo.c
index b6af26f..8506193 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);
-- 
1.7.8.1

--
To unsubscribe from this list: send the line "unsubscribe linux-modules" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux