core: ltc: sm2: add missing status check

crypto_acipher_sm2_pke_decrypt() fails to check a return status from
LibTomCrypt. Add the missing check.

Fixes: f9a78287dd12 ("core: ltc: add support for SM2 PKE")
Signed-off-by: Jerome Forissier <jerome@forissier.org>
Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
diff --git a/core/lib/libtomcrypt/sm2-pke.c b/core/lib/libtomcrypt/sm2-pke.c
index 4937bb9..a089a7e 100644
--- a/core/lib/libtomcrypt/sm2-pke.c
+++ b/core/lib/libtomcrypt/sm2-pke.c
@@ -182,7 +182,7 @@
 		ltc_res = ltc_ecc_is_point_at_infinity(C1, ltc_key.dp.prime,
 						       &inf);
 	}
-	if (inf) {
+	if (ltc_res != CRYPT_OK || inf) {
 		res = TEE_ERROR_BAD_STATE;
 		goto out;
 	}