[PATCH v2 10/19] rsatoc: check error value of gen_key()

Sascha Hauer s.hauer at pengutronix.de
Wed Jul 31 22:57:28 PDT 2024


exit with an error in case gen_key() fails, otherwise errors go through
unnoticed.

Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
 scripts/rsatoc.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/scripts/rsatoc.c b/scripts/rsatoc.c
index c7bc4ba843..27f0afe61f 100644
--- a/scripts/rsatoc.c
+++ b/scripts/rsatoc.c
@@ -471,7 +471,7 @@ static int gen_key(const char *keyname, const char *path)
 int main(int argc, char *argv[])
 {
 	char *path, *keyname;
-	int i, opt;
+	int i, opt, ret;
 	char *outfile = NULL;
 
 	outfilep = stdout;
@@ -542,7 +542,9 @@ int main(int argc, char *argv[])
 			}
 		}
 
-		gen_key(keyname, path);
+		ret = gen_key(keyname, path);
+		if (ret)
+			exit(1);
 	}
 
 	if (dts) {
-- 
2.39.2




More information about the barebox mailing list