aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafał Miłecki <rafal@milecki.pl>2021-04-09 09:21:25 +0200
committerRafał Miłecki <rafal@milecki.pl>2021-04-09 10:46:15 +0200
commit052a30d65e90ac9b3359f4a23aa3024d102c178c (patch)
treed859432c8f94883220be2d48e0d8dc84f10c620d
parenta2f66229450dc2f7647c19ac83f3948e809406c2 (diff)
downloadupstream-052a30d65e90ac9b3359f4a23aa3024d102c178c.tar.gz
upstream-052a30d65e90ac9b3359f4a23aa3024d102c178c.tar.bz2
upstream-052a30d65e90ac9b3359f4a23aa3024d102c178c.zip
firmware-utils: fix -Wmaybe-uninitialized warnings
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
-rw-r--r--tools/firmware-utils/src/asustrx.c3
-rw-r--r--tools/firmware-utils/src/mkcasfw.c7
-rw-r--r--tools/firmware-utils/src/mkcsysimg.c3
-rw-r--r--tools/firmware-utils/src/mkdapimg.c3
-rw-r--r--tools/firmware-utils/src/mkdapimg2.c3
-rw-r--r--tools/firmware-utils/src/mkrtn56uimg.c3
6 files changed, 18 insertions, 4 deletions
diff --git a/tools/firmware-utils/src/asustrx.c b/tools/firmware-utils/src/asustrx.c
index b3daeedcfd..04af9a184a 100644
--- a/tools/firmware-utils/src/asustrx.c
+++ b/tools/firmware-utils/src/asustrx.c
@@ -150,7 +150,8 @@ static void usage() {
int main(int argc, char **argv) {
struct trx_header hdr;
struct asustrx_tail tail = { };
- FILE *in, *out;
+ FILE *out = NULL;
+ FILE *in = NULL;
uint8_t buf[1024];
size_t bytes;
size_t length = 0;
diff --git a/tools/firmware-utils/src/mkcasfw.c b/tools/firmware-utils/src/mkcasfw.c
index eb92c8e3ff..904000c78d 100644
--- a/tools/firmware-utils/src/mkcasfw.c
+++ b/tools/firmware-utils/src/mkcasfw.c
@@ -554,6 +554,10 @@ csum_get(struct csum_state *css)
break;
case CSUM_TYPE_32:
ret = csum32_get(css);
+ break;
+ default:
+ ERR("invalid checksum size\n");
+ return 0;
}
return ret;
@@ -755,6 +759,9 @@ write_out_header(FILE *outfile)
res = write_out_data(outfile, (uint8_t *)&tmp.nfs,
sizeof(tmp.nfs), NULL);
break;
+ default:
+ ERR("invalid header type\n");
+ return -EINVAL;
}
return res;
diff --git a/tools/firmware-utils/src/mkcsysimg.c b/tools/firmware-utils/src/mkcsysimg.c
index 7c0002c404..e156f79153 100644
--- a/tools/firmware-utils/src/mkcsysimg.c
+++ b/tools/firmware-utils/src/mkcsysimg.c
@@ -493,6 +493,9 @@ csum_get(struct csum_state *css)
case CSUM_SIZE_16:
ret = csum16_get(css);
break;
+ default:
+ ERR("invalid checksum size\n");
+ return 0;
}
return ret;
diff --git a/tools/firmware-utils/src/mkdapimg.c b/tools/firmware-utils/src/mkdapimg.c
index 640f42d7c6..0031d83dd0 100644
--- a/tools/firmware-utils/src/mkdapimg.c
+++ b/tools/firmware-utils/src/mkdapimg.c
@@ -68,7 +68,8 @@ main(int ac, char *av[])
int fixmode = 0;
int have_regionversion = 0;
- FILE *ifile, *ofile;
+ FILE *ifile = NULL;
+ FILE *ofile = NULL;
int c;
uint32_t cksum;
uint32_t bcnt;
diff --git a/tools/firmware-utils/src/mkdapimg2.c b/tools/firmware-utils/src/mkdapimg2.c
index 6b53c959b6..1d09290a16 100644
--- a/tools/firmware-utils/src/mkdapimg2.c
+++ b/tools/firmware-utils/src/mkdapimg2.c
@@ -92,7 +92,8 @@ main(int ac, char *av[])
char region[MAX_REG_LEN];
int kernel = 0;
- FILE *ifile, *ofile;
+ FILE *ifile = NULL;
+ FILE *ofile = NULL;
int c;
uint32_t cksum;
diff --git a/tools/firmware-utils/src/mkrtn56uimg.c b/tools/firmware-utils/src/mkrtn56uimg.c
index 6b72e1e233..b6c891bbdc 100644
--- a/tools/firmware-utils/src/mkrtn56uimg.c
+++ b/tools/firmware-utils/src/mkrtn56uimg.c
@@ -251,7 +251,8 @@ int
main(int argc, char **argv)
{
int opt;
- char *filename, *progname;
+ char *filename = NULL;
+ char *progname;
op_mode_t opmode = NONE;
progname = argv[0];