mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-01-03 01:17:45 +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.
(cherry picked from commit ccfc534dee
)
This commit is contained in:
parent
f9370f9188
commit
617c67a039
@ -167,9 +167,9 @@ int lsm_bpf_supported(void) {
|
||||
if (r < 0)
|
||||
return supported = 0;
|
||||
|
||||
r = bpf_can_link_lsm_program(obj->progs.restrict_filesystems);
|
||||
if (r < 0) {
|
||||
log_warning_errno(r, "Failed to link BPF program. Assuming BPF is not available: %m");
|
||||
if (!bpf_can_link_lsm_program(obj->progs.restrict_filesystems)) {
|
||||
log_warning_errno(SYNTHETIC_ERRNO(EOPNOTSUPP),
|
||||
"Failed to link BPF program. Assuming BPF is not available");
|
||||
return supported = 0;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user