From df761d5a6bb8deede515f6ab8ca656f8778ec24b Mon Sep 17 00:00:00 2001
From: Gilles Peskine <Gilles.Peskine@arm.com>
Date: Thu, 1 Mar 2018 22:18:14 +0100
Subject: [PATCH] Fix build with gcc -O -Wall

Fix warnings from gcc -O -Wall about `ret` used uninitialized in
CMAC selftest auxiliary functions. The variable was indeed
uninitialized if the function was called with num_tests=0 (which
never happens).
---
 library/cmac.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/library/cmac.c b/library/cmac.c
index 9dbff90386..a76313e94b 100644
--- a/library/cmac.c
+++ b/library/cmac.c
@@ -832,6 +832,7 @@ static int cmac_test_subkeys( int verbose,
         mbedtls_cipher_free( &ctx );
     }
 
+    ret = 0;
     goto exit;
 
 cleanup:
@@ -887,6 +888,7 @@ static int cmac_test_wth_cipher( int verbose,
         if( verbose != 0 )
             mbedtls_printf( "passed\n" );
     }
+    ret = 0;
 
 exit:
     return( ret );