examples/tls_server: fix svace warning
authorJoohwan Kim <joohwani.kim@samsung.com>
Mon, 21 Aug 2017 10:50:53 +0000 (19:50 +0900)
committersunghan <sh924.chang@samsung.com>
Wed, 20 Sep 2017 07:47:31 +0000 (16:47 +0900)
This commit fixes svace warning about UNREACHABLE_CODE.

Change-Id: I5937a681e34fa29195026f64a4260a1c4fb2de01
Signed-off-by: Joohwan Kim <joohwani.kim@samsung.com>
apps/examples/tls_server/tls_server_main.c

index 5970e50..248b320 100644 (file)
@@ -1736,12 +1736,12 @@ usage:
 #if defined(MBEDTLS_FS_IO)
        if (opt.dhm_file != NULL) {
                ret = mbedtls_ssl_conf_dh_param_ctx(&conf, &dhm);
+               if (ret != 0) {
+                       mbedtls_printf("  failed\n  mbedtls_ssl_conf_dh_param returned -0x%04X\n\n", -ret);
+                       goto exit;
+               }
        }
 #endif
-       if (ret != 0) {
-               mbedtls_printf("  failed\n  mbedtls_ssl_conf_dh_param returned -0x%04X\n\n", -ret);
-               goto exit;
-       }
 #endif
 
        if (opt.min_version != DFL_MIN_VERSION) {