ManageabilityPkg: refactor SsifWriteRequest #1 Separate input validation from argument marshalling. Signed-off-by: Leif Lindholm <leif.lindholm@oss.qualcomm.com>
diff --git a/ManageabilityPkg/Library/ManageabilityTransportSsifLib/SsifCommon.c b/ManageabilityPkg/Library/ManageabilityTransportSsifLib/SsifCommon.c index 597cd79..4d60777 100644 --- a/ManageabilityPkg/Library/ManageabilityTransportSsifLib/SsifCommon.c +++ b/ManageabilityPkg/Library/ManageabilityTransportSsifLib/SsifCommon.c
@@ -68,7 +68,6 @@ } MiddleCount = 0; - IsMultiPartWrite = FALSE; Status = EFI_SUCCESS; if (RequestDataSize > IPMI_SSIF_MAXIMUM_PACKET_SIZE_IN_BYTES) { @@ -80,7 +79,11 @@ DEBUG ((DEBUG_ERROR, "%a: The request data size exceeds the maximum transfer blocks: RequestDataSize = %d, maximum transfer blocks = %d.\n", __func__, RequestDataSize, (1 << 8) - 1 + 2)); return EFI_INVALID_PARAMETER; } + } else { + IsMultiPartWrite = FALSE; + } + if (IsMultiPartWrite) { MiddleCount = ((RequestDataSize - 1) / IPMI_SSIF_MAXIMUM_PACKET_SIZE_IN_BYTES) - 1; if ( ((MiddleCount == 0) && (mTransactionSupport == IPMI_GET_SYSTEM_INTERFACE_CAPABILITIES_SSIF_TRANSACTION_SUPPORT_SINGLE_PARTITION_RW))