From: Shuah Khan <shuah@kernel.org>
To: kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] kselftest/cgroup: fix a signedness bug
Date: Thu, 07 Jun 2018 19:46:15 +0000 [thread overview]
Message-ID: <37c8d24c-cfe5-ce86-8973-7b920112f59c@kernel.org> (raw)
In-Reply-To: <20180607125224.GA4302@castle>
On 06/07/2018 06:52 AM, Roman Gushchin wrote:
> On Thu, Jun 07, 2018 at 11:30:02AM +0300, Dan Carpenter wrote:
>> "len" needs to be signed for the error handling to work.
>>
>> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>>
>> 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 @@ 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);
>>
>
> Looks good to me!
>
> Thanks!
>
Thanks. Is it now in linux-kselftest next. I will send this up next week
for second update for 4.18-rc1
-- Shuah
prev parent reply other threads:[~2018-06-07 19:46 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-07 8:30 [PATCH] kselftest/cgroup: fix a signedness bug Dan Carpenter
2018-06-07 12:52 ` Roman Gushchin
2018-06-07 19:46 ` Shuah Khan [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=37c8d24c-cfe5-ce86-8973-7b920112f59c@kernel.org \
--to=shuah@kernel.org \
--cc=kernel-janitors@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox