[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAP-5=fXPe9277agFqyEQsOG8h_wM5zFh3Sz+NFpsacU+A5MOuA@mail.gmail.com>
Date: Fri, 15 Nov 2024 10:57:59 -0800
From: Ian Rogers <irogers@...gle.com>
To: Jiapeng Chong <jiapeng.chong@...ux.alibaba.com>
Cc: peterz@...radead.org, mingo@...hat.com, acme@...nel.org,
namhyung@...nel.org, mark.rutland@....com, alexander.shishkin@...ux.intel.com,
jolsa@...nel.org, adrian.hunter@...el.com, kan.liang@...ux.intel.com,
linux-perf-users@...r.kernel.org, linux-kernel@...r.kernel.org,
Abaci Robot <abaci@...ux.alibaba.com>
Subject: Re: [PATCH -next] perf tests: Fix an incorrect type in append_script()
On Fri, Nov 15, 2024 at 1:15 AM Jiapeng Chong
<jiapeng.chong@...ux.alibaba.com> wrote:
>
> The return value from the call to readlink() is ssize_t. However, the
> return value is being assigned to an size_t variable 'len', so making
> 'len' an ssize_t.
>
> ./tools/perf/tests/tests-scripts.c:182:5-8: WARNING: Unsigned expression compared with zero: len < 0.
>
> Reported-by: Abaci Robot <abaci@...ux.alibaba.com>
> Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=11909
> Signed-off-by: Jiapeng Chong <jiapeng.chong@...ux.alibaba.com>
Reviewed-by: Ian Rogers <irogers@...gle.com>
Thanks,
Ian
> ---
> tools/perf/tests/tests-scripts.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/perf/tests/tests-scripts.c b/tools/perf/tests/tests-scripts.c
> index cf3ae0c1d871..1d5759d08141 100644
> --- a/tools/perf/tests/tests-scripts.c
> +++ b/tools/perf/tests/tests-scripts.c
> @@ -174,7 +174,7 @@ static void append_script(int dir_fd, const char *name, char *desc,
> char filename[PATH_MAX], link[128];
> struct test_suite *test_suite, **result_tmp;
> struct test_case *tests;
> - size_t len;
> + ssize_t len;
> char *exclusive;
>
> snprintf(link, sizeof(link), "/proc/%d/fd/%d", getpid(), dir_fd);
> --
> 2.32.0.3.g01195cf9f
>
Powered by blists - more mailing lists