[U-Boot] [PATCH v5 003/101] dm: core: Fix offset_to_ofnode() with invalid offset
Bin Meng
bmeng.cn at gmail.com
Mon Nov 25 14:54:19 UTC 2019
On Mon, Nov 25, 2019 at 12:11 PM Simon Glass <sjg at chromium.org> wrote:
>
> If the offset is -1 this function correctly sets up a null ofnode. But if
> the offset is any other negative number (e.g. -FDT_ERR_BADPATH) then it
> does the wrong thing.
>
> An offset of -1 in ofnode indicates that the ofnode is not valid. Any
> other negative value is not handled by ofnode_valid(). We could of course
> change that function, but it seems much better to always use the same
> value for an invalid node.
>
> Fix it by setting the offset to -1 if it is invalid for any reason.
>
> Signed-off-by: Simon Glass <sjg at chromium.org>
> ---
>
> Changes in v5: None
> Changes in v4:
> - Update the commit message to be clearer, fix 'correct' typo
>
> Changes in v3: None
> Changes in v2: None
>
> include/dm/ofnode.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
Reviewed-by: Bin Meng <bmeng.cn at gmail.com>
More information about the U-Boot
mailing list