Commit 53c3daf8 authored by Dan Carpenter's avatar Dan Carpenter Committed by Shuah Khan (Samsung OSG)

kselftest/cgroup: fix a signedness bug

"len" needs to be signed for the error handling to work.
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarShuah Khan (Samsung OSG) <shuah@kernel.org>
parent 9855c462
...@@ -35,7 +35,7 @@ static ssize_t read_text(const char *path, char *buf, size_t max_len) ...@@ -35,7 +35,7 @@ static ssize_t read_text(const char *path, char *buf, size_t max_len)
return len; return len;
} }
static ssize_t write_text(const char *path, char *buf, size_t len) static ssize_t write_text(const char *path, char *buf, ssize_t len)
{ {
int fd; int fd;
...@@ -140,7 +140,7 @@ long cg_read_key_long(const char *cgroup, const char *control, const char *key) ...@@ -140,7 +140,7 @@ long cg_read_key_long(const char *cgroup, const char *control, const char *key)
int cg_write(const char *cgroup, const char *control, char *buf) int cg_write(const char *cgroup, const char *control, char *buf)
{ {
char path[PATH_MAX]; char path[PATH_MAX];
size_t len = strlen(buf); ssize_t len = strlen(buf);
snprintf(path, sizeof(path), "%s/%s", cgroup, control); snprintf(path, sizeof(path), "%s/%s", cgroup, control);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment