mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-08-30 05:50:12 +03:00
bpf: fix bpf_can_link_lsm_program condition
Since bpf_can_link_lsm_program return value is boolean, the expression `r < 0` is always false.
This commit is contained in:
@ -167,9 +167,9 @@ int lsm_bpf_supported(void) {
|
|||||||
if (r < 0)
|
if (r < 0)
|
||||||
return supported = 0;
|
return supported = 0;
|
||||||
|
|
||||||
r = bpf_can_link_lsm_program(obj->progs.restrict_filesystems);
|
if (!bpf_can_link_lsm_program(obj->progs.restrict_filesystems)) {
|
||||||
if (r < 0) {
|
log_warning_errno(SYNTHETIC_ERRNO(EOPNOTSUPP),
|
||||||
log_warning_errno(r, "Failed to link BPF program. Assuming BPF is not available: %m");
|
"Failed to link BPF program. Assuming BPF is not available");
|
||||||
return supported = 0;
|
return supported = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user