Messages in this thread | | | Date | Thu, 16 Mar 2006 13:33:49 +0900 (JST) | Subject | Re: [PATCH] for_each_possible_cpu [1/19] defines for_each_possible_cpu | From | YOSHIFUJI Hideaki / 吉藤英明 <> |
| |
In article <20060316131743.d7b716e9.kamezawa.hiroyu@jp.fujitsu.com> (at Thu, 16 Mar 2006 13:17:43 +0900), KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> says:
> cpu_msrs[i].coutners are allocated by for_each_online_cpu(). > and free it by for_each_possible_cpus() without no pointer check.
No...
> - kfree(cpu_msrs[i].counters); > + for_each_possible_cpu(i) { > + if (cpu_msrs[i].counters) > + kfree(cpu_msrs[i].counters);
kfree() checks its argument for you.
> 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;
ditto.
--yoshfuji - 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/
| |