[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20080923183411.GD25045@linux-os.sc.intel.com>
Date: Tue, 23 Sep 2008 11:34:12 -0700
From: Suresh Siddha <suresh.b.siddha@...el.com>
To: Cyrill Gorcunov <gorcunov@...il.com>
Cc: "Siddha, Suresh B" <suresh.b.siddha@...el.com>,
Ingo Molnar <mingo@...e.hu>,
LKML <linux-kernel@...r.kernel.org>,
"Maciej W. Rozycki" <macro@...ux-mips.org>
Subject: Re: [PATCH -tip/master] x86: io-apic - interrupt remapping fix
On Mon, Sep 22, 2008 at 09:56:37PM -0700, Cyrill Gorcunov wrote:
> [Suresh Siddha - Mon, Sep 22, 2008 at 06:16:21PM -0700]
> | On Mon, Sep 22, 2008 at 05:57:38PM -0700, Siddha, Suresh B wrote:
> | > On Fri, Sep 19, 2008 at 05:33:20AM -0700, Cyrill Gorcunov wrote:
> | > > Interrupt remapping could lead to NULL dereference in case of
> | > > kzalloc failed and memory leak in other way. So fix the
> | > > both cases.
> | > >
> | > > Signed-off-by: Cyrill Gorcunov <gorcunov@...il.com>
> | > > ---
> | > >
> | > > Ingo, the patch is on top of applied one.
> | > >
> | > > If I remember correctly Suresh was involved in
> | > > this - so I think he could take a look and review
> | > > the patch (please).
> | > >
> | >
> | > Acked-by: Suresh Siddha <suresh.b.siddha@...el.com>
> |
> | oops. Cyrill some typo here:
> |
> | + for (; apic > 0; apic--)
> | + kfree(early_ioapic_entries[apic]);
> | + kfree(early_ioapic_entries[apic]);
> |
>
> Hi Suresh, thanks for review!
>
> Well it's not typo actually :) Of course it could
> be like
>
> for (--apic; apic > 0; apic--)
> or
> for (apic--; apic > 0; apic--)
>
> but it will be a rpoblem in case if apic = 0 and
> if someday apic would be unsigned int. So I prefered
> to have _one_ kfree(NULL) call instead :)
>
> I hope i didn't miss anything.
This is too confusing. Please change it to something simple, like:
for (i = 0; i < apic; i++)
kfree(early_ioapic_entries[i]);
or
for (apic = 0; apic < nr_ioapics; apic++)
kfree(early_ioapic_entries[apic]);
thanks,
suresh
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists