mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Oleksij Rempel <o.rempel@pengutronix.de>
Cc: barebox@lists.infradead.org,
	Steffen Trumtrar <s.trumtrar@pengutronix.de>
Subject: Re: [PATCH v1 1/2] bootm: fit: support multiple configuration nodes
Date: Wed, 22 Mar 2017 08:08:06 +0100	[thread overview]
Message-ID: <20170322070806.6uwbggidlwfbylsd@pengutronix.de> (raw)
In-Reply-To: <20170320125540.8431-1-o.rempel@pengutronix.de>

On Mon, Mar 20, 2017 at 01:55:39PM +0100, Oleksij Rempel wrote:
> From: Steffen Trumtrar <s.trumtrar@pengutronix.de>
> 
> Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
> Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
> ---
>  common/image-fit.c | 39 +++++++++++++++++++++++++++++++++++++--
>  1 file changed, 37 insertions(+), 2 deletions(-)
> 
> diff --git a/common/image-fit.c b/common/image-fit.c
> index 6a01c614c..48c021347 100644
> --- a/common/image-fit.c
> +++ b/common/image-fit.c
> @@ -489,6 +489,37 @@ static int fit_config_verify_signature(struct fit_handle *handle, struct device_
>  	return ret;
>  }
>  
> +static int fit_find_compatible_unit(struct device_node *conf_node,
> +				    const char **unit)
> +{
> +	struct device_node *child = NULL;
> +	struct device_node *barebox_root;
> +	const char *machine;
> +	int ret;
> +
> +	barebox_root = of_get_root_node();
> +	if (!barebox_root)
> +		return -ENOSYS;
> +
> +	ret = of_property_read_string(barebox_root, "compatible", &machine);
> +	if (ret)
> +		return -ENOENT;
> +
> +	for_each_child_of_node(conf_node, child) {
> +		if (of_device_is_compatible(child, machine)) {
> +			*unit = xasprintf("%s", child->name);

This is never freed. *unit is a const char * in the caller.

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 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

      parent reply	other threads:[~2017-03-22  7:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-20 12:55 Oleksij Rempel
2017-03-20 12:55 ` [PATCH v1 2/2] bootm: fit: support rsa2048 Oleksij Rempel
2017-03-22  7:09   ` Sascha Hauer
2017-03-22  7:08 ` Sascha Hauer [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170322070806.6uwbggidlwfbylsd@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=o.rempel@pengutronix.de \
    --cc=s.trumtrar@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox