[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180823111355.GD29735@dhcp22.suse.cz>
Date: Thu, 23 Aug 2018 13:13:55 +0200
From: Michal Hocko <mhocko@...nel.org>
To: Weikang Shi <swkhack@...il.com>
Cc: akpm@...ux-foundation.org, alexander.h.duyck@...el.com,
vbabka@...e.cz, mgorman@...e.de, l.stach@...gutronix.de,
vdavydov.dev@...il.com, linux-mm@...ck.org,
linux-kernel@...r.kernel.org, my_email@...il.com
Subject: Re: [PATCH] fs: fix local var type
On Thu 23-08-18 01:59:14, Weikang Shi wrote:
> In the seq_hex_dump function,the remaining variable is int, but it receive a type of size_t argument.
> So I change the type of remaining
The changelog should explain _why_ we need this fix. Is any of the code
path overflowing?
Besides that I do not think this fix is complete. What about linelen?
Why do we even need len to be size_t? Why it cannot be int as well. I
strongly doubt we need more than 32b here.
> Signed-off-by: Weikang Shi <swkhack@...il.com>
> ---
> fs/seq_file.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/fs/seq_file.c b/fs/seq_file.c
> index 1dea7a8..d0e8bec 100644
> --- a/fs/seq_file.c
> +++ b/fs/seq_file.c
> @@ -847,7 +847,8 @@ void seq_hex_dump(struct seq_file *m, const char *prefix_str, int prefix_type,
> bool ascii)
> {
> const u8 *ptr = buf;
> - int i, linelen, remaining = len;
> + int i, linelen;
> + size_t remaining = len;
> char *buffer;
> size_t size;
> int ret;
> --
> 2.7.4
>
--
Michal Hocko
SUSE Labs
Powered by blists - more mailing lists