Skip to content

Commit 38b28e2

Browse files
author
Arto Kinnunen
authored
Fix coverity error (ARMmbed#1943)
Fix CID 1397068: Error handling issues (CHECKED_RETURN)
1 parent c4afedc commit 38b28e2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

source/Service_Libs/CCM_lib/mbedOS/aes_mbedtls_adapter.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,9 @@ arm_aes_context_t *arm_aes_start(const uint8_t key[static 16])
8383
arm_aes_context_t *context = mbed_tls_context_get();
8484
if (context) {
8585
mbedtls_aes_init(&context->ctx);
86-
mbedtls_aes_setkey_enc(&context->ctx, key, 128);
86+
if (0 != mbedtls_aes_setkey_enc(&context->ctx, key, 128)) {
87+
return NULL;
88+
}
8789
}
8890
return context;
8991
}

0 commit comments

Comments
 (0)