From: Wolfgang Denk Date: Wed, 19 Jan 2011 00:05:07 +0100 Subject: [U-Boot] [PATCH] cmd_jffs2: Fix get_part_sector_size_nor() overflow bug In-Reply-To: <1293745676-1557-1-git-send-email-ptyser@xes-inc.com> References: <1293745676-1557-1-git-send-email-ptyser@xes-inc.com> Message-ID: <20110118230507.1F96936C@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Peter Tyser, In message <1293745676-1557-1-git-send-email-ptyser@xes-inc.com> you wrote: > When a flash partition was positioned at the very top of a 32-bit memory > map (eg located at 0xf8000000 with a size of 0x8000000) > get_part_sector_size_nor() would incorrectly calculate the partition's > ending address to 0x0 due to overflow. When the overflow occurred > get_part_sector_size_nor() would falsely return a sector size of 0. > A sector size of 0 results in subsequent jffs2 operations failing. > > To workaround the overflow subtract 1 from calculated address of > the partition endpoint. > > Signed-off-by: Peter Tyser > --- > common/cmd_jffs2.c | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) Applied. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de I am a computer. I am dumber than any human and smarter than any ad- ministrator.