From: Tom Rini Date: Thu, 4 Feb 2016 14:14:36 -0500 Subject: [U-Boot] [PATCH] malloc: solve dead code issue in memalign() In-Reply-To: <1454612060-13327-1-git-send-email-swarren@wwwdotorg.org> References: <1454612060-13327-1-git-send-email-swarren@wwwdotorg.org> Message-ID: <20160204191436.GP25786@bill-the-cat> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Thu, Feb 04, 2016 at 11:54:20AM -0700, Stephen Warren wrote: > From: Stephen Warren > > The recent change to memalign() caused the allocation failure detection > code to be dead code; the "retry" logic is always activated under the same > condition that the original failure detection code is, and also fully > handles any possible failures. This patch solves the presence of dead > code. > > Two alternatives are possible: > > a) Delete the now-dead test, and rely on the "retry" path to handle any > allocation problems, as it does. > > b) Make the "retry" path fall through to the existing (currently dead) > failure detection code, thus making it not-dead. > > (b) was chosen since it reduces the diff between U-Boot's and the upstream > dlmalloc. This should make it marginally easier to import a new version of > dlmalloc in the future. > > Reported by: Coverity Scan > Fixes: 4f144a416469 ("malloc: work around some memalign fragmentation issues") > Signed-off-by: Stephen Warren Thanks for the quick turn-around! Reviewed-by: Tom Rini -- Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: