dfu: free entities when parsing fails
authorStephen Warren <swarren@nvidia.com>
Tue, 10 Jun 2014 16:06:41 +0000 (10:06 -0600)
committerMarek Vasut <marex@denx.de>
Wed, 25 Jun 2014 20:49:43 +0000 (22:49 +0200)
commitafb8e71caea6784e8c3ff18cab7f27c46511878a
treedf35b19e6f2ae6bddf9a15553e8529a6431a2ba0
parent08ebd467c8649493404e5cc513abd096076c733e
dfu: free entities when parsing fails

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>
Acked-by: Lukasz Majewski <l.majewski@samsung.com>
Tested-by: Lukasz Majewski <l.majewski@samsung.com>
common/cmd_dfu.c