[PATCH 7/7] blspec: use correct return type

Sascha Hauer s.hauer at pengutronix.de
Thu Jul 7 00:43:42 PDT 2016


On Wed, Jul 06, 2016 at 08:44:40PM +0200, Lucas Stach wrote:
> Signed-off-by: Lucas Stach <dev at lynxeye.de>
> ---
>  common/blspec.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/common/blspec.c b/common/blspec.c
> index bf98e6b..04b20fb 100644
> --- a/common/blspec.c
> +++ b/common/blspec.c
> @@ -253,7 +253,7 @@ static bool entry_is_of_compatible(struct blspec_entry *entry)
>  	const char *abspath;
>  	size_t size;
>  	void *fdt = NULL;
> -	int ret;
> +	bool ret;
>  	struct device_node *root = NULL, *barebox_root;
>  	const char *compat;
>  	char *filename;

I suspect this is not the only bug in this function. We also do a:

	root = of_unflatten_dtb(fdt);
	if (IS_ERR(root)) {
		ret = PTR_ERR(root);
		goto out;
	}

...

out:
	return ret;

So we return 'true' when we failed unflattening the device tree, this surely
is not intended. Should the function return int instead?

Sascha


-- 
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