From: Christian Brauner Date: Wed, 15 Apr 2020 11:46:46 +0000 (+0200) Subject: cgroups: use correct NULL pointer check X-Git-Tag: lxc-5.0.0~451^2~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7484656d639a76f0ec94db0c9dca414310de0e26;p=thirdparty%2Flxc.git cgroups: use correct NULL pointer check Fixes: Coverity 1461722. Fixes: Coverity 1461737. Signed-off-by: Christian Brauner --- diff --git a/src/lxc/cgroups/cgroup2_devices.c b/src/lxc/cgroups/cgroup2_devices.c index b120521b3..04ba7b332 100644 --- a/src/lxc/cgroups/cgroup2_devices.c +++ b/src/lxc/cgroups/cgroup2_devices.c @@ -514,7 +514,7 @@ bool bpf_devices_cgroup_supported(void) "The bpf device cgroup requires real root"); prog = bpf_program_new(BPF_PROG_TYPE_CGROUP_DEVICE); - if (prog < 0) + if (!prog) return log_trace(false, "Failed to allocate new bpf device cgroup program"); ret = bpf_program_add_instructions(prog, dummy, ARRAY_SIZE(dummy));