From: Dan Carpenter Date: Thu, 13 Jun 2019 07:00:21 +0000 (+0300) Subject: selftests/bpf: signedness bug in enable_all_controllers() X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=cabd3e889b5772a0dc448ddca9a4b23591640bca;p=openwrt%2Fstaging%2Fblogic.git selftests/bpf: signedness bug in enable_all_controllers() The "len" variable needs to be signed for the error handling to work properly. Fixes: 596092ef8bea ("selftests/bpf: enable all available cgroup v2 controllers") Signed-off-by: Dan Carpenter Acked-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann --- diff --git a/tools/testing/selftests/bpf/cgroup_helpers.c b/tools/testing/selftests/bpf/cgroup_helpers.c index 0d89f0396be4..e95c33e333a4 100644 --- a/tools/testing/selftests/bpf/cgroup_helpers.c +++ b/tools/testing/selftests/bpf/cgroup_helpers.c @@ -47,7 +47,7 @@ int enable_all_controllers(char *cgroup_path) char buf[PATH_MAX]; char *c, *c2; int fd, cfd; - size_t len; + ssize_t len; snprintf(path, sizeof(path), "%s/cgroup.controllers", cgroup_path); fd = open(path, O_RDONLY);