Hi Rui, Thank you for your review.
2013/04/16 17:17, Wang, Rui Y wrote:
-----Original Message----- From: Yasuaki Ishimatsu <isimatu.yasu...@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: a...@linux-foundation.org Cc: linux-kernel@vger.kernel.org, rient...@google.com, linux...@us.ibm.com, toshi.k...@hp.com, Yasuaki Ishimatsu <isimatu.yasu...@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
-- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/