mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-25 07:20:53 +07: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 @@ 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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user