From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ulf Samuelsson Date: Sun, 19 Aug 2007 15:04:12 +0200 Subject: [U-Boot-Users] FIX: dataflash.c References: <20070819005029.7D7AD246C5@gemini.denx.de> <46C7BAF7.3080905@gandalf.sssup.it> Message-ID: <001e01c7e291$304c98d0$dcc4af0a@atmel.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de > for (i = 0; i < CFG_MAX_DATAFLASH_BANKS; i++) > if ( dataflash_info[i].id > - && ((((int) addr) & 0xFF000000) == > + && ((((unsigned int) *addr) & 0xFF000000) == > dataflash_info[i].logical_address)) { > addr_valid = 1; > break; > > It fix an invalid use of a pointer and and invalid use of an array. > > regards michael > > AFAIK, This patch is introducing a bug. The intention of the code is to check if "addr" is within 0xC0000000..0xCFFFFFFF or 0xD0000000..0xDFFFFFFF. Your patch will make the ARM core *read* from whereever 'addr' is pointing at. 'addr' is an address specified by the user! You do not know *where* is it located, and if the ARM reads from an arbitrary address, there is a big chance that it will trap... Best Regards Ulf Samuelsson