mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "YOSHIFUJI Hideaki / 吉藤英明" <yoshfuji@linux-ipv6.org>
To: kamezawa.hiroyu@jp.fujitsu.com
Cc: nickpiggin@yahoo.com.au, linux-kernel@vger.kernel.org,
	akpm@osdl.org, yoshfuji@linux-ipv6.org
Subject: Re: [PATCH] for_each_possible_cpu [1/19] defines for_each_possible_cpu
Date: Thu, 16 Mar 2006 13:33:49 +0900 (JST)	[thread overview]
Message-ID: <20060316.133349.44436898.yoshfuji@linux-ipv6.org> (raw)
In-Reply-To: <20060316131743.d7b716e9.kamezawa.hiroyu@jp.fujitsu.com>

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

      parent reply	other threads:[~2006-03-16  4:31 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-16  3:21 KAMEZAWA Hiroyuki
2006-03-16  3:40 ` Andrew Morton
2006-03-16  4:13   ` KAMEZAWA Hiroyuki
2006-03-16  3:43 ` Nick Piggin
2006-03-16  3:55   ` Andrew Morton
2006-03-16  4:08     ` Nick Piggin
2006-03-16  4:17   ` KAMEZAWA Hiroyuki
2006-03-16  4:24     ` Nick Piggin
2006-03-16  6:22       ` KAMEZAWA Hiroyuki
2006-03-16  6:49         ` Nick Piggin
2006-03-16  9:48           ` Andrew Morton
2006-03-16 10:04             ` Nick Piggin
2006-03-16  4:33     ` YOSHIFUJI Hideaki / 吉藤英明 [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060316.133349.44436898.yoshfuji@linux-ipv6.org \
    --to=yoshfuji@linux-ipv6.org \
    --cc=akpm@osdl.org \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nickpiggin@yahoo.com.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®