kmod_module_probe_insert_module returns 0 on success, != 0 on failure

More specifically, it should return > 0 only for conditions specified in
probe_flags. We only set KMOD_PROBE_APPLY_BLACKLIST in probe_flags, so the
code was correct, but add an assert to clarify this.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2017-10-08 22:29:32 +02:00
parent 232ac0d681
commit 2c3f0bb207
2 changed files with 6 additions and 7 deletions
+3 -2
View File
@@ -118,8 +118,9 @@ static int load_module(struct kmod_ctx *ctx, const char *m) {
else if (err == KMOD_PROBE_APPLY_BLACKLIST)
log_info("Module '%s' is blacklisted", kmod_module_get_name(mod));
else {
log_error_errno(err, "Failed to insert '%s': %m", kmod_module_get_name(mod));
r = err;
assert(err < 0);
r = log_error_errno(err, "Failed to insert '%s': %m",
kmod_module_get_name(mod));
}
}
}