From c4e950ea530be43731ccced813303e9980343c22 Mon Sep 17 00:00:00 2001 From: Kenneth Soerensen Date: Thu, 3 Jan 2019 12:39:29 +0100 Subject: [PATCH] Backport 2.x: Remove compiler warning if only MBEDTLS_PK_PARSE_C is defined Warning reported with IAR compiler: "mbedtls\library\pkparse.c",1167 Warning[Pe550]: variable "ret" was set but never used Signed-off-by: Kenneth Soerensen --- library/pkparse.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/library/pkparse.c b/library/pkparse.c index 3222ca20f..535ed70eb 100644 --- a/library/pkparse.c +++ b/library/pkparse.c @@ -1380,8 +1380,11 @@ int mbedtls_pk_parse_key( mbedtls_pk_context *pk, } #endif /* MBEDTLS_PKCS12_C || MBEDTLS_PKCS5_C */ - if( ( ret = pk_parse_key_pkcs8_unencrypted_der( pk, key, keylen ) ) == 0 ) + ret = pk_parse_key_pkcs8_unencrypted_der( pk, key, keylen ); + if( ret == 0 ) + { return( 0 ); + } mbedtls_pk_free( pk ); mbedtls_pk_init( pk );