From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefan Roese Date: Thu, 23 May 2013 09:50:12 +0200 Subject: [U-Boot] [PATCH 2/2] cfi_flash: return NULL for invalid base address input In-Reply-To: <1368769837-10630-3-git-send-email-yamada.m@jp.panasonic.com> References: <1368769837-10630-1-git-send-email-yamada.m@jp.panasonic.com> <1368769837-10630-3-git-send-email-yamada.m@jp.panasonic.com> Message-ID: <519DCA34.8030905@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 On 05/17/2013 07:50 AM, Masahiro Yamada wrote: > When base address given was out of valid flash address ranges, > flash_get_info() function returned the pointer to the last > element of flash_info[i] array. > > This patch changes this function to return NULL pointer > in such a case, which is more correct behaviour. > > The function flash_protect_default() calls flash_protect() > immediately after flash_get_info() invocation. > With this correction, flash_protect() function would be > able to return soon, for NULL flash_info. Applied to u-boot-cfi-flash/master. Thanks, Stefan