From: Tom Rini Date: Fri, 16 Apr 2021 08:25:29 -0400 Subject: [PATCH v2 1/7] spl: fit: Don't overwrite previous loadable if "load" is missing In-Reply-To: <20210329170516.1893519-2-mr.nuke.me@gmail.com> References: <20210329170516.1893519-1-mr.nuke.me@gmail.com> <20210329170516.1893519-2-mr.nuke.me@gmail.com> Message-ID: <20210416122529.GU1310@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 Mon, Mar 29, 2021 at 12:05:10PM -0500, Alexandru Gagniuc wrote: > spl_load_fit_image() will try to load an image at the address given > in the "load" property. Absent such property, it uses > > image_info->load_addr > > Correct use of this is demonstrated in spl_fit_append_fdt(), which > resets the 'load_addr' before each spl_load_fit_image() call. > > On the other hand loading "loadables" loop in spl_load_simple_fit() > completely ignores this. It re-uses the same structure, but doesn't > reset load_addr. If loadable [i] does not have a "load" property, its > load address defaults to load_addr, which still contains the address > of loadable [i - 1]. > > A simple solution is to treat NULL as an invalid load address. The > caller can set load_addr = 0 to request an abort if the "load" > property is absent. > > Signed-off-by: Alexandru Gagniuc > Reviewed-by: Simon Glass Applied to u-boot/master, thanks! -- Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: