diff options
author | root <root@rshg054.dnsready.net> | 2012-01-06 23:14:57 +0000 |
---|---|---|
committer | root <root@rshg054.dnsready.net> | 2012-01-06 23:14:57 +0000 |
commit | d7931e8fa49a4698ac8dbb1a155ca6b48f031828 (patch) | |
tree | 281739e3992b9ac2dbb722ea6f84d1015fe1a365 /testing/kmod/return-non-zero-on-fail.patch | |
parent | 817e58c278cb8ebee7743205877d0f67c431fcec (diff) |
Fri Jan 6 23:14:57 UTC 2012
Diffstat (limited to 'testing/kmod/return-non-zero-on-fail.patch')
-rw-r--r-- | testing/kmod/return-non-zero-on-fail.patch | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/testing/kmod/return-non-zero-on-fail.patch b/testing/kmod/return-non-zero-on-fail.patch new file mode 100644 index 000000000..4802a825f --- /dev/null +++ b/testing/kmod/return-non-zero-on-fail.patch @@ -0,0 +1,30 @@ +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); +diff --git a/tools/kmod-modprobe.c b/tools/kmod-modprobe.c +index 8286b9b..6ca94f2 100644 +--- a/tools/kmod-modprobe.c ++++ b/tools/kmod-modprobe.c +@@ -856,7 +856,7 @@ static int insmod_alias(struct kmod_ctx *ctx, const char *alias, const char *ext + + if (list == NULL) { + LOG("Module %s not found.\n", alias); +- return err; ++ return -ENOENT; + } + + if (use_blacklist) { |