[PATCH] blspec: fix return value of entry_is_of_compatible()

Sascha Hauer s.hauer at pengutronix.de
Tue Sep 27 23:29:33 PDT 2016


On Tue, Sep 27, 2016 at 09:30:58AM +0200, Ulrich Ölmann wrote:
> The function returns a boolean and not an integer. Hence the former
> explicit/implicit cast of an ERR_PTR to a boolean has led to a return value of
> true although a bootspec entry with a faulty devicetree is not compatible.
> 
> Signed-off-by: Ulrich Ölmann <u.oelmann at pengutronix.de>
> ---
>  common/blspec.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Applied, thanks

Sascha

> 
> diff --git a/common/blspec.c b/common/blspec.c
> index c205d481c911..40d4546d2880 100644
> --- a/common/blspec.c
> +++ b/common/blspec.c
> @@ -398,7 +398,7 @@ static bool entry_is_of_compatible(struct blspec_entry *entry)
>  
>  	root = of_unflatten_dtb(fdt);
>  	if (IS_ERR(root)) {
> -		ret = PTR_ERR(root);
> +		ret = false;
>  		root = NULL;
>  		goto out;
>  	}
> -- 
> 2.9.3
> 
> 
> _______________________________________________
> barebox mailing list
> barebox at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



More information about the barebox mailing list