diff mbox series

hawkbit: process_notification_thread shall check data_avail before status

Message ID 1586766852-208-1-git-send-email-Cedric_Hombourger@mentor.com
State Accepted
Headers show
Series hawkbit: process_notification_thread shall check data_avail before status | expand

Commit Message

Cedric Hombourger April 13, 2020, 8:34 a.m. UTC
Add missing check for data being available in process_notification_thread()
It would otherwise cause read of uninitialized status data (as reported by
valgrind).

Signed-off-by: Cedric Hombourger <Cedric_Hombourger@mentor.com>
---
 suricatta/server_hawkbit.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Stefano Babic April 13, 2020, 8:52 a.m. UTC | #1
Hi Cedric,

On 13/04/20 10:34, Cedric Hombourger wrote:
> Add missing check for data being available in process_notification_thread()
> It would otherwise cause read of uninitialized status data (as reported by
> valgrind).
> 
> Signed-off-by: Cedric Hombourger <Cedric_Hombourger@mentor.com>
> ---
>  suricatta/server_hawkbit.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/suricatta/server_hawkbit.c b/suricatta/server_hawkbit.c
> index 0b0e00b..a4638af 100644
> --- a/suricatta/server_hawkbit.c
> +++ b/suricatta/server_hawkbit.c
> @@ -942,7 +942,7 @@ static void *process_notification_thread(void *data)
>  			stop = true;
>  		}
>  
> -		if (msg.data.status.current == PROGRESS)
> +		if (data_avail && msg.data.status.current == PROGRESS)
>  			continue;
>  		/*
>  		 * If there is a message
> 

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

Best regards,
Stefano Babic
diff mbox series

Patch

diff --git a/suricatta/server_hawkbit.c b/suricatta/server_hawkbit.c
index 0b0e00b..a4638af 100644
--- a/suricatta/server_hawkbit.c
+++ b/suricatta/server_hawkbit.c
@@ -942,7 +942,7 @@  static void *process_notification_thread(void *data)
 			stop = true;
 		}
 
-		if (msg.data.status.current == PROGRESS)
+		if (data_avail && msg.data.status.current == PROGRESS)
 			continue;
 		/*
 		 * If there is a message