Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753141Ab3DQADb (ORCPT ); Tue, 16 Apr 2013 20:03:31 -0400 Received: from fgwmail6.fujitsu.co.jp ([192.51.44.36]:52726 "EHLO fgwmail6.fujitsu.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751140Ab3DQAD3 (ORCPT ); Tue, 16 Apr 2013 20:03:29 -0400 X-SecurityPolicyCheck: OK by SHieldMailChecker v1.7.4 Message-ID: <516DE6AC.3000602@jp.fujitsu.com> Date: Wed, 17 Apr 2013 09:02:52 +0900 From: Yasuaki Ishimatsu User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:17.0) Gecko/20130328 Thunderbird/17.0.5 MIME-Version: 1.0 To: "Wang, Rui Y" CC: "akpm@linux-foundation.org" , "linux-kernel@vger.kernel.org" , "rientjes@google.com" , "linuxram@us.ibm.com" , "toshi.kani@hp.com" Subject: Re: [Bug fix PATCH] resource: Reusing a resource structure allocated by bootmem References: <516B62C0.70504@jp.fujitsu.com> In-Reply-To: Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1319 Lines: 46 Hi Rui, Thank you for your review. 2013/04/16 17:17, Wang, Rui Y wrote: >> -----Original Message----- >> From: Yasuaki Ishimatsu >> 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 >> <<...>> >> + 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 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/