mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-10 07:10:27 +00:00
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:
parent
9855c4626c
commit
53c3daf8cf
@ -35,7 +35,7 @@ out:
|
||||
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);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user