[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Mon, 11 Nov 2019 11:12:48 +0100
From: Michal Hocko <mhocko@...nel.org>
To: Qian Cai <cai@....pw>
Cc: akpm@...ux-foundation.org, hannes@...xchg.org, guro@...com,
linux-mm@...ck.org, cgroups@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH -next] mm/vmscan: fix an undefined behavior for zone id
On Fri 08-11-19 16:26:52, Qian Cai wrote:
>
>
> > On Nov 8, 2019, at 3:44 PM, Qian Cai <cai@....pw> wrote:
> >
> > - for (zid = 0; zid <= zone_idx; zid++) {
> > + for (zid = 0; zid < zone_idx; zid++) {
> > struct zone *zone =
>
> Oops, I think here needs to be,
>
> for (zid = 0; zid <= zone_idx && zid < MAX_NR_ZONES; zid++) {
>
> to deal with this MAX_NR_ZONES special case.
Yep this looks correct.
Thanks!
--
Michal Hocko
SUSE Labs
Powered by blists - more mailing lists