From: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
To: "Wang, Rui Y" <rui.y.wang@intel.com>
Cc: "akpm@linux-foundation.org" <akpm@linux-foundation.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"rientjes@google.com" <rientjes@google.com>,
"linuxram@us.ibm.com" <linuxram@us.ibm.com>,
"toshi.kani@hp.com" <toshi.kani@hp.com>
Subject: Re: [Bug fix PATCH] resource: Reusing a resource structure allocated by bootmem
Date: Wed, 17 Apr 2013 09:02:52 +0900 [thread overview]
Message-ID: <516DE6AC.3000602@jp.fujitsu.com> (raw)
In-Reply-To: <FC9702EC51E4CA40A875703BEBD6CEF89E5B64@SHSMSX101.ccr.corp.intel.com>
Hi Rui,
Thank you for your review.
2013/04/16 17:17, Wang, Rui Y wrote:
>> -----Original Message-----
>> From: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
>> Date: Mon, 15 Apr 2013 11:15:28 +0900
>> Subject: [Bug fix PATCH] resource: Reusing a resource structure allocated by
>> bootmem
>> To: akpm@linux-foundation.org
>> Cc: linux-kernel@vger.kernel.org, rientjes@google.com, linuxram@us.ibm.com,
>> toshi.kani@hp.com, Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
>> <<...>>
>> + if (bootmem_resource.sibling) {
>> + spin_lock(&bootmem_resource_lock);
>> + res = bootmem_resource.sibling;
>> + bootmem_resource.sibling = res->sibling;
>> + spin_unlock(&bootmem_resource_lock);
>> + memset(res, 0, sizeof(struct resource));
>> + } else {
>> + res = kzalloc(sizeof(struct resource), flags);
>> + }
>
> bootmem_resource_lock does not protect the if() statement from accessing bootmem_resource.sibling.
>
> spin_lock(&bootmem_resource_lock);
> if (bootmem_resource.sibling) {
You are right. I'll update it.
Thanks,
Yasuaki Ishimatsu
> ...
>
> Rui
>
prev parent reply other threads:[~2013-04-17 0:03 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-15 2:15 [Bug fix PATCH] resource: Reusing a resource structure allocated by bootmem Yasuaki Ishimatsu
2013-04-15 20:01 ` Toshi Kani
2013-04-16 0:34 ` Yasuaki Ishimatsu
[not found] ` <CANVTcTZoNVh7i=iEqAcqSNSZ9vtRVxRkV=sm73S3sEDEYAHRGQ@mail.gmail.com>
2013-04-16 8:17 ` Wang, Rui Y
2013-04-17 0:02 ` Yasuaki Ishimatsu [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=516DE6AC.3000602@jp.fujitsu.com \
--to=isimatu.yasuaki@jp.fujitsu.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxram@us.ibm.com \
--cc=rientjes@google.com \
--cc=rui.y.wang@intel.com \
--cc=toshi.kani@hp.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.