[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1d9b6d7c-097d-d6c3-82e5-a46077f3ce44@redhat.com>
Date: Tue, 5 Jan 2021 12:03:18 +0100
From: David Hildenbrand <david@...hat.com>
To: YANG LI <abaci-bugfix@...ux.alibaba.com>, hannes@...xchg.org
Cc: mhocko@...nel.org, vdavydov.dev@...il.com,
akpm@...ux-foundation.org, cgroups@...r.kernel.org,
linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mm: fix: Uninitialized variable ret.
On 30.12.20 07:59, YANG LI wrote:
> The ret is being used but it isn't being initialized,
> need to assign a value to it, like 0.
>
> Signed-off-by: YANG LI <abaci-bugfix@...ux.alibaba.com>
> Reported-by: Abaci <abaci@...ux.alibaba.com>
> ---
> mm/memcontrol.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/mm/memcontrol.c b/mm/memcontrol.c
> index 605f671..15ba17d 100644
> --- a/mm/memcontrol.c
> +++ b/mm/memcontrol.c
> @@ -3366,7 +3366,7 @@ static int mem_cgroup_resize_max(struct mem_cgroup *memcg,
> {
> bool enlarge = false;
> bool drained = false;
> - int ret;
> + int ret = 0;
> bool limits_invariant;
> struct page_counter *counter = memsw ? &memcg->memsw : &memcg->memory;
>
>
Before every "break" in the loop, we have a "ret = ". The loop runs at
least once.
Either I am missing something important, or that patch claims something
that does not hold - at least upstream.
--
Thanks,
David / dhildenb
Powered by blists - more mailing lists