public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Lukasz Majewski <l.majewski@samsung.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] dfu: free entities when parsing fails
Date: Wed, 18 Jun 2014 08:15:30 +0200	[thread overview]
Message-ID: <20140618081530.506fc92d@amdc2363> (raw)
In-Reply-To: <1402416401-14011-1-git-send-email-swarren@wwwdotorg.org>

Hi Stephen,

> From: Stephen Warren <swarren@nvidia.com>
> 
> When dfu_init_env_entities() fails part-way through, some entities may
> have been added to dfu_list. These are only removed by
> dfu_free_entities(). If that function isn't called, those stale
> entities will still exist the next time dfu_init_env_entities() is
> called, leading to confusion. Fix do_dfu() to ensure that
> dfu_free_entities() is always called, to avoid this confusion.
> 
> Signed-off-by: Stephen Warren <swarren@nvidia.com>
> ---
>  common/cmd_dfu.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/common/cmd_dfu.c b/common/cmd_dfu.c
> index a03538dabb37..433bddd5d2bd 100644
> --- a/common/cmd_dfu.c
> +++ b/common/cmd_dfu.c
> @@ -27,8 +27,9 @@ static int do_dfu(cmd_tbl_t *cmdtp, int flag, int
> argc, char * const argv[]) ret = dfu_init_env_entities(interface,
> simple_strtoul(devstring, NULL, 10));
>  	if (ret)
> -		return ret;
> +		goto done;
>  
> +	ret = CMD_RET_SUCCESS;
>  	if (argc > 4 && strcmp(argv[4], "list") == 0) {
>  		dfu_show_entities();
>  		goto done;
> @@ -61,7 +62,7 @@ done:
>  	if (dfu_reset())
>  		run_command("reset", 0);
>  
> -	return CMD_RET_SUCCESS;
> +	return ret;
>  }
>  
>  U_BOOT_CMD(dfu, CONFIG_SYS_MAXARGS, 1, do_dfu,

Acked-by: Lukasz Majewski <l.majewski@samsung.com>

Test HW: Exynos4412 - Trats2

Tested-by: Lukasz Majewski <l.majewski@samsung.com>

-- 
Best regards,

Lukasz Majewski

Samsung R&D Institute Poland (SRPOL) | Linux Platform Group

      reply	other threads:[~2014-06-18  6:15 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-10 16:06 [U-Boot] [PATCH] dfu: free entities when parsing fails Stephen Warren
2014-06-18  6:15 ` Lukasz Majewski [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=20140618081530.506fc92d@amdc2363 \
    --to=l.majewski@samsung.com \
    --cc=u-boot@lists.denx.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