Skip to content

Commit

Permalink
cgroups: use correct NULL pointer check
Browse files Browse the repository at this point in the history
Fixes: Coverity 1461722.
Fixes: Coverity 1461737.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
  • Loading branch information
Christian Brauner committed Apr 15, 2020
1 parent 67e7246 commit 7484656
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lxc/cgroups/cgroup2_devices.c
Expand Up @@ -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));
Expand Down

0 comments on commit 7484656

Please sign in to comment.