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:
@@ -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));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user