From 83ff1fc386f3585baa5ec6055909588bef4685d5 Mon Sep 17 00:00:00 2001 From: Ahmad Fatoum Date: Mon, 5 Sep 2022 11:55:57 +0200 Subject: net: fastboot: keep error message initialized at all times Static analyzer points out that an unfortunate sequence of fastboot commands can have us end up with an uninitialized error_msg, so initialize it in that case, so we have something in there at all times. Signed-off-by: Ahmad Fatoum Link: https://lore.barebox.org/20220905095557.596891-33-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer --- net/fastboot.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'net') diff --git a/net/fastboot.c b/net/fastboot.c index aa483f57a7..932eb05c43 100644 --- a/net/fastboot.c +++ b/net/fastboot.c @@ -126,6 +126,8 @@ static void fastboot_send(struct fastboot_net *fbn, if (error_msg) header.id = FASTBOOT_ERROR; + else + error_msg = "no error"; /* send header */ memcpy(packet, &header, sizeof(header)); -- cgit v1.2.1