summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorAhmad Fatoum <a.fatoum@pengutronix.de>2022-09-05 11:55:57 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2022-09-12 12:05:02 +0200
commit83ff1fc386f3585baa5ec6055909588bef4685d5 (patch)
treef3b2b2b6469be9d3da6387bc4782fcbf75edae0e /net
parent3ec7206cb496a0b992f18acf30bd88e8af5e9ac9 (diff)
downloadbarebox-83ff1fc386f3585baa5ec6055909588bef4685d5.tar.gz
barebox-83ff1fc386f3585baa5ec6055909588bef4685d5.tar.xz
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 <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220905095557.596891-33-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'net')
-rw-r--r--net/fastboot.c2
1 files changed, 2 insertions, 0 deletions
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));