diff mbox series

Fix coverity #292169

Message ID 20200420092927.3582-3-sbabic@denx.de
State Accepted
Headers show
Series Fix coverity #292169 | expand

Commit Message

Stefano Babic April 20, 2020, 9:29 a.m. UTC
Signed-off-by: Stefano Babic <sbabic@denx.de>
---
 handlers/swuforward_handler.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/handlers/swuforward_handler.c b/handlers/swuforward_handler.c
index 8719967..a1fdab3 100644
--- a/handlers/swuforward_handler.c
+++ b/handlers/swuforward_handler.c
@@ -342,6 +342,8 @@  static int install_remote_swu(struct img_type *img,
 		conn->total_bytes = img->size;
 		conn->SWUpdateStatus = IDLE;
 
+		LIST_INSERT_HEAD(&priv.conns, conn, next);
+
 		/*
 		 * Create one FIFO for each connection to be thread safe
 		 */
@@ -362,7 +364,6 @@  static int install_remote_swu(struct img_type *img,
 			ret = FAILURE;
 			goto handler_exit;
 		}
-		LIST_INSERT_HEAD(&priv.conns, conn, next);
 
 		index++;
 	}