platform-mc: fix double header subtraction in getFRURecordTable
The responseLen returned by sendRecvPldmMsg is already payload-only.
Subtracting sizeof(pldm_msg_hdr) again in getFRURecordTable caused the
last 3 bytes of the FRU record table data to be silently truncated.
Remove the redundant sizeof(pldm_msg_hdr) subtraction to match the
convention used by all other decode calls in platform_manager.cpp.
Fixes: b6d3943 ("platform-mc: discovery FRU data from terminus")
Change-Id: I748bc5993f9aa66e11f1ee699478ad1fd3558bda
Co-developed-by: Arun P. Mohanan <arun.p.m@intel.com>
Signed-off-by: Vishnunithyasoundhar S <vishnunithyasoundhar.s@intel.com>
diff --git a/platform-mc/platform_manager.cpp b/platform-mc/platform_manager.cpp
index 234e117..9d9338c 100644
--- a/platform-mc/platform_manager.cpp
+++ b/platform-mc/platform_manager.cpp
@@ -778,8 +778,8 @@
auto responsePtr = reinterpret_cast<const struct pldm_msg*>(responseMsg);
rc = decode_get_fru_record_table_resp(
- responsePtr, responseLen - sizeof(pldm_msg_hdr), &completionCode,
- nextDataTransferHndl, transferFlag, recordData.data(), responseCnt);
+ responsePtr, responseLen, &completionCode, nextDataTransferHndl,
+ transferFlag, recordData.data(), responseCnt);
if (rc)
{