diff mbox series

handlers/swuforward_handler.c: Correct failing returns

Message ID 20201214221711.32367-1-bage@linutronix.de
State Accepted
Headers show
Series handlers/swuforward_handler.c: Correct failing returns | expand

Commit Message

Bastian Germann Dec. 14, 2020, 10:17 p.m. UTC
From: Bastian Germann <bage@linutronix.de>

install_remote_swu() will return a good state in case of two error states.
Fix them to return FAILURE like most of the other errors.

Signed-off-by: Bastian Germann <bage@linutronix.de>
---
 handlers/swuforward_handler.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Stefano Babic Dec. 15, 2020, 2:20 p.m. UTC | #1
Hi Bastian,

On 14.12.20 23:17, bage@linutronix.de wrote:
> From: Bastian Germann <bage@linutronix.de>
> 
> install_remote_swu() will return a good state in case of two error states.
> Fix them to return FAILURE like most of the other errors.
> 
> Signed-off-by: Bastian Germann <bage@linutronix.de>
> ---
>  handlers/swuforward_handler.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/handlers/swuforward_handler.c b/handlers/swuforward_handler.c
> index a1fdab3..1d94710 100644
> --- a/handlers/swuforward_handler.c
> +++ b/handlers/swuforward_handler.c
> @@ -370,12 +370,14 @@ static int install_remote_swu(struct img_type *img,
>  
>  	if (initialize_backchannel(&priv)) {
>  		ERROR("Cannot initialize back connection");
> +		ret = FAILURE;
>  		goto handler_exit;
>  	}
>  
>  	ret = copyimage(&priv, img, swu_forward_data);
>  	if (ret) {
>  		ERROR("Transferring SWU image was not successful");
> +		ret = FAILURE;
>  		goto handler_exit;
>  	}
>  
> 

Acked-by: Stefano Babic <sbabic@denx.de>

Best regards,
Stefano Babic
diff mbox series

Patch

diff --git a/handlers/swuforward_handler.c b/handlers/swuforward_handler.c
index a1fdab3..1d94710 100644
--- a/handlers/swuforward_handler.c
+++ b/handlers/swuforward_handler.c
@@ -370,12 +370,14 @@  static int install_remote_swu(struct img_type *img,
 
 	if (initialize_backchannel(&priv)) {
 		ERROR("Cannot initialize back connection");
+		ret = FAILURE;
 		goto handler_exit;
 	}
 
 	ret = copyimage(&priv, img, swu_forward_data);
 	if (ret) {
 		ERROR("Transferring SWU image was not successful");
+		ret = FAILURE;
 		goto handler_exit;
 	}