diff options
author | suryaprakash.konduru <suryaprakash.konduru@nxp.com> | 2023-03-23 11:17:19 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2023-03-23 11:17:19 +0000 |
commit | fcda8a64e6d32a2faa6c53c08893640abcd41d7c (patch) | |
tree | 192b921637b52df1e27fcb3f0796c1a4960329f9 | |
parent | 2bcbb5fdd274007ec621f2fa7dececcd700b2e4a (diff) | |
parent | d088b9cbabc2f6fc95c5fc9352fd7e8110663ad4 (diff) | |
download | secure_element-fcda8a64e6d32a2faa6c53c08893640abcd41d7c.tar.gz |
Fix Coverity warnings. am: 6382ac4086 am: 11c8cd389a am: 93167646e3 am: d088b9cbab
Original change: https://android-review.googlesource.com/c/platform/hardware/nxp/secure_element/+/2497315
Change-Id: I8457ac76470452d063eb634ea5eed21cb42bd7c5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r-- | snxxx/aidl/VirtualISO.cpp | 4 | ||||
-rw-r--r--[-rwxr-xr-x] | snxxx/libese-spi/p73/lib/phNxpEseProto7816_3.cpp | 7 | ||||
-rw-r--r--[-rwxr-xr-x] | snxxx/libese-spi/p73/lib/phNxpEse_Api.cpp | 12 |
3 files changed, 19 insertions, 4 deletions
diff --git a/snxxx/aidl/VirtualISO.cpp b/snxxx/aidl/VirtualISO.cpp index f4d5c59..571e365 100644 --- a/snxxx/aidl/VirtualISO.cpp +++ b/snxxx/aidl/VirtualISO.cpp @@ -589,7 +589,9 @@ ESESTATUS VirtualISO::seHalInit() { } deInitStatus = phNxpEse_deInit(); } - phNxpEse_close(deInitStatus); + if (phNxpEse_close(deInitStatus) != ESESTATUS_SUCCESS) { + LOG(INFO) << "VISO close is not successful"; + } mIsEseInitialized = false; } return status; diff --git a/snxxx/libese-spi/p73/lib/phNxpEseProto7816_3.cpp b/snxxx/libese-spi/p73/lib/phNxpEseProto7816_3.cpp index 8c7ae81..5a3d01d 100755..100644 --- a/snxxx/libese-spi/p73/lib/phNxpEseProto7816_3.cpp +++ b/snxxx/libese-spi/p73/lib/phNxpEseProto7816_3.cpp @@ -1560,7 +1560,12 @@ static ESESTATUS phNxpEseProto7816_ProcessResponse(void) { } phNxpEseProto7816_3_Var.timeoutCounter = PH_PROTO_7816_VALUE_ZERO; NXP_LOG_ESE_D("%s calling phNxpEse_StoreDatainList", __FUNCTION__); - status = phNxpEse_StoreDatainList(data_len, p_data); + ESESTATUS storeDataStatus = phNxpEse_StoreDatainList(data_len, p_data); + if (storeDataStatus != ESESTATUS_SUCCESS) { + NXP_LOG_ESE_D("%s :phNxpEse_StoreDatainList failed. status = %x", + __FUNCTION__, storeDataStatus); + status = storeDataStatus; + } } } } diff --git a/snxxx/libese-spi/p73/lib/phNxpEse_Api.cpp b/snxxx/libese-spi/p73/lib/phNxpEse_Api.cpp index fbb85c1..5fc188e 100755..100644 --- a/snxxx/libese-spi/p73/lib/phNxpEse_Api.cpp +++ b/snxxx/libese-spi/p73/lib/phNxpEse_Api.cpp @@ -1,6 +1,6 @@ /****************************************************************************** * - * Copyright 2018-2022 NXP + * Copyright 2018-2023 NXP * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -1232,7 +1232,15 @@ ESESTATUS phNxpEse_read(uint32_t* data_len, uint8_t** pp_data) { *pp_data = nxpese_ctxt.p_read_buff; status = ESESTATUS_FAILED; } else { - PH_PAL_ESE_PRINT_PACKET_RX(nxpese_ctxt.p_read_buff, (uint16_t)ret); + if (ret > MAX_DATA_LEN) { + NXP_LOG_ESE_E( + "%s PAL Read buffer length(%x) is greater than MAX_DATA_LEN(%x) ", + __FUNCTION__, ret, MAX_DATA_LEN); + PH_PAL_ESE_PRINT_PACKET_RX(nxpese_ctxt.p_read_buff, + (uint16_t)MAX_DATA_LEN); + } else { + PH_PAL_ESE_PRINT_PACKET_RX(nxpese_ctxt.p_read_buff, (uint16_t)ret); + } *data_len = ret; *pp_data = nxpese_ctxt.p_read_buff; status = ESESTATUS_SUCCESS; |