From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from de01egw02.freescale.net (de01egw02.freescale.net [192.88.165.103]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "de01egw02.freescale.net", Issuer "Thawte Premium Server CA" (verified OK)) by ozlabs.org (Postfix) with ESMTP id 51FE5DDF23 for ; Thu, 5 Apr 2007 04:28:05 +1000 (EST) Message-ID: <4613EE2C.3070104@freescale.com> Date: Wed, 04 Apr 2007 13:27:56 -0500 From: Timur Tabi MIME-Version: 1.0 To: Scott Wood Subject: Re: [PATCH] powerpc: change rheap functions to use long integers instead of pointers References: <11756161753280-git-send-email-timur@freescale.com> <4613E39A.70606@freescale.com> <4613E7CC.1020001@246tNt.com> <20070404181351.GA19855@ld0162-tx32.am.freescale.net> <4613EC2F.80109@freescale.com> <4613ED4F.2030203@freescale.com> In-Reply-To: <4613ED4F.2030203@freescale.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Cc: linuxppc-dev@ozlabs.org, Sylvain Munaut List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Scott Wood wrote: >> The same patch should be applied to rh_detach_region() and >> rh_alloc_fixed(). > > You should check "e" instead, and make sure that s < e. Now that I look at the code, I think there's a bug in the calculation of 'e'. 'e' is rounded down, and it's based on the unaligned value of 'start'. Instead, 'size' should be rounded up, and 'e' should be based on 's' (i.e. the aligned value of 'start'). Otherwise, if you pass an unaligned value of 'start', then the buffer you get back will be less than 'size'. -- Timur Tabi Linux Kernel Developer @ Freescale