[U-Boot] image-fit: Fix fit_get_node_from_config semantics

Tom Rini trini at konsulko.com
Fri Sep 23 20:37:16 CEST 2016


On Tue, Sep 20, 2016 at 06:17:12PM +0100, Paul Burton wrote:

> Commit bac17b78dace ("image-fit: switch ENOLINK to ENOENT") changed
> fit_get_node_from_config to return -ENOENT when a property doesn't
> exist, but didn't change any of its callers which check return values.
> Notably it didn't change boot_get_ramdisk, which leads to U-Boot failing
> to boot FIT images which don't include ramdisks with the following
> message:
> 
>   Ramdisk image is corrupt or invalid
> 
> It also didn't take into account that by returning -ENOENT to denote the
> lack of a property we lost the ability to determine from the return
> value of fit_get_node_from_config whether it was the property or the
> configuration node that was missing, which may potentially lead callers
> to accept invalid FIT images.
> 
> Fix this by having fit_get_node_from_config return -EINVAL when the
> configuration node isn't found and -ENOENT when the property isn't
> found, which seems to make semantic sense. Callers that previously
> checked for -ENOLINK are adjusted to check for -ENOENT, which fixes the
> breakage introduced by commit bac17b78dace ("image-fit: switch ENOLINK
> to ENOENT").
> 
> The only other user of the return fit_get_node_from_config return value,
> indirectly, is bootm_find_os which already checked for -ENOENT. From a
> read-through of the code I suspect it ought to have been checking for
> -ENOLINK prior to bac17b78dace ("image-fit: switch ENOLINK to ENOENT")
> anyway, which would make it right after this patch, but this would be
> good to get verified by someone who knows this x86 code or is able to
> test it.
> 
> Signed-off-by: Paul Burton <paul.burton at imgtec.com>
> Cc: Jonathan Gray <jsg at jsg.id.au>
> Cc: Marek Vasut <marex at denx.de>
> Acked-by: Marek Vasut <marex at denx.de>
> Acked-by: Stefan Roese <sr at denx.de>
> Acked-by: George McCollister <george.mccollister at gmail.com>
> Tested-by: George McCollister <george.mccollister at gmail.com>

A few days ago now, applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160923/42441384/attachment.sig>


More information about the U-Boot mailing list