mirror of
https://github.com/systemd/systemd
synced 2024-10-15 12:34:37 +00:00
modules-load: simplify OOM check
This commit is contained in:
parent
f2d0e2e5f5
commit
0b3c270896
|
@ -172,10 +172,8 @@ static int run(int argc, char *argv[]) {
|
||||||
log_warning_errno(r, "Failed to parse kernel command line, ignoring: %m");
|
log_warning_errno(r, "Failed to parse kernel command line, ignoring: %m");
|
||||||
|
|
||||||
ctx = kmod_new(NULL, NULL);
|
ctx = kmod_new(NULL, NULL);
|
||||||
if (!ctx) {
|
if (!ctx)
|
||||||
log_error("Failed to allocate memory for kmod.");
|
return log_oom();
|
||||||
return -ENOMEM;
|
|
||||||
}
|
|
||||||
|
|
||||||
kmod_load_resources(ctx);
|
kmod_load_resources(ctx);
|
||||||
kmod_set_log_fn(ctx, systemd_kmod_log, NULL);
|
kmod_set_log_fn(ctx, systemd_kmod_log, NULL);
|
||||||
|
|
Loading…
Reference in a new issue