selftests/bpf: signedness bug in enable_all_controllers()

The "len" variable needs to be signed for the error handling to work
properly.

Fixes: 596092ef8b ("selftests/bpf: enable all available cgroup v2 controllers")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
This commit is contained in:
Dan Carpenter 2019-06-13 10:00:21 +03:00 committed by Daniel Borkmann
parent b552d33c80
commit cabd3e889b
1 changed files with 1 additions and 1 deletions

View File

@ -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);