diff options
| author | Dan Carpenter <dan.carpenter@oracle.com> | 2018-06-07 04:30:02 -0400 |
|---|---|---|
| committer | Shuah Khan (Samsung OSG) <shuah@kernel.org> | 2018-06-07 15:44:30 -0400 |
| commit | 53c3daf8cfeae4b1289723c7abeb9540c1630cf8 (patch) | |
| tree | 9a2a9a6bd3293b459b8e20f77710f014eed0cb9c | |
| parent | 9855c4626c67abc24902246ba961e6dd9022dd27 (diff) | |
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>
| -rw-r--r-- | tools/testing/selftests/cgroup/cgroup_util.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/testing/selftests/cgroup/cgroup_util.c b/tools/testing/selftests/cgroup/cgroup_util.c index b69bdeb4b9fe..1e9e3c470561 100644 --- a/tools/testing/selftests/cgroup/cgroup_util.c +++ b/tools/testing/selftests/cgroup/cgroup_util.c | |||
| @@ -35,7 +35,7 @@ out: | |||
| 35 | return len; | 35 | return len; |
| 36 | } | 36 | } |
| 37 | 37 | ||
| 38 | static ssize_t write_text(const char *path, char *buf, size_t len) | 38 | static ssize_t write_text(const char *path, char *buf, ssize_t len) |
| 39 | { | 39 | { |
| 40 | int fd; | 40 | int fd; |
| 41 | 41 | ||
| @@ -140,7 +140,7 @@ long cg_read_key_long(const char *cgroup, const char *control, const char *key) | |||
| 140 | int cg_write(const char *cgroup, const char *control, char *buf) | 140 | int cg_write(const char *cgroup, const char *control, char *buf) |
| 141 | { | 141 | { |
| 142 | char path[PATH_MAX]; | 142 | char path[PATH_MAX]; |
| 143 | size_t len = strlen(buf); | 143 | ssize_t len = strlen(buf); |
| 144 | 144 | ||
| 145 | snprintf(path, sizeof(path), "%s/%s", cgroup, control); | 145 | snprintf(path, sizeof(path), "%s/%s", cgroup, control); |
| 146 | 146 | ||
