kselftest/cgroup: fix a signedness bug

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

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Shuah Khan (Samsung OSG) <shuah@kernel.org>
This commit is contained in:
Dan Carpenter 2018-06-07 11:30:02 +03:00 committed by Shuah Khan (Samsung OSG)
parent 9855c4626c
commit 53c3daf8cf

View File

@ -35,7 +35,7 @@ static ssize_t read_text(const char *path, char *buf, size_t max_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;
@ -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)
{
char path[PATH_MAX];
size_t len = strlen(buf);
ssize_t len = strlen(buf);
snprintf(path, sizeof(path), "%s/%s", cgroup, control);