From b88af0c2da11557a7aad9733fd1e3f018a2d9993 Mon Sep 17 00:00:00 2001 From: Bojun Seo Date: Tue, 8 Oct 2024 11:27:57 +0900 Subject: [PATCH] libbpf-tools/profile: Check if nr_cpus is zero --- libbpf-tools/profile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libbpf-tools/profile.c b/libbpf-tools/profile.c index 63c811a29e9..81e2b4212fe 100644 --- a/libbpf-tools/profile.c +++ b/libbpf-tools/profile.c @@ -584,7 +584,7 @@ int main(int argc, char **argv) libbpf_set_print(libbpf_print_fn); nr_cpus = libbpf_num_possible_cpus(); - if (nr_cpus < 0) { + if (nr_cpus <= 0) { printf("failed to get # of possible cpus: '%s'!\n", strerror(-nr_cpus)); return 1;