mirror of
https://github.com/systemd/systemd
synced 2024-07-22 02:34:54 +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");
|
||||
|
||||
ctx = kmod_new(NULL, NULL);
|
||||
if (!ctx) {
|
||||
log_error("Failed to allocate memory for kmod.");
|
||||
return -ENOMEM;
|
||||
}
|
||||
if (!ctx)
|
||||
return log_oom();
|
||||
|
||||
kmod_load_resources(ctx);
|
||||
kmod_set_log_fn(ctx, systemd_kmod_log, NULL);
|
||||
|
|
Loading…
Reference in a new issue