lkml.org 
[lkml]   [2006]   [Mar]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] for_each_possible_cpu [1/19] defines for_each_possible_cpu
On Thu, 16 Mar 2006 14:43:38 +1100
Nick Piggin <nickpiggin@yahoo.com.au> wrote:

> The only places where things might care is arch bootup code, but
> the cpu interface is such that the arch code is expected to _hide_
> any weird details from these generic interfaces.
>
Please see i386 patch. it contains BUG fix.
cpu_msrs[i].coutners are allocated by for_each_online_cpu().
and free it by for_each_possible_cpus() without no pointer check.

I think this kind of confusion will be seen again in future.
--Kame
--
static void free_msrs(void)
{
int i;
- for_each_cpu(i) {
- kfree(cpu_msrs[i].counters);
+ for_each_possible_cpu(i) {
+ if (cpu_msrs[i].counters)
+ kfree(cpu_msrs[i].counters);
cpu_msrs[i].counters = NULL;
- kfree(cpu_msrs[i].controls);
+ if (cpu_msrs[i].controls)
+ kfree(cpu_msrs[i].controls);
cpu_msrs[i].controls = NULL;
}
}
--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-03-16 05:21    [W:0.058 / U:8.656 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site