]> git.baikalelectronics.ru Git - arm-tf.git/commitdiff
fix(intel): fix the pointer of block memory to fill in and bytes being set
authorSieu Mun Tang <sieu.mun.tang@intel.com>
Tue, 21 Mar 2023 07:11:08 +0000 (15:11 +0800)
committerSieu Mun Tang <sieu.mun.tang@intel.com>
Mon, 10 Apr 2023 16:20:24 +0000 (00:20 +0800)
Fix on the pointer of the block memory to fill in and the number of
bytes to be set. So it can clear the exact address with exact number
of bytes.

Signed-off-by: Sieu Mun Tang <sieu.mun.tang@intel.com>
Signed-off-by: Jit Loon Lim <jit.loon.lim@intel.com>
Change-Id: Idb8bda446ecd4c1d85d1ec9802bdcb020904c6c1

plat/intel/soc/common/sip/socfpga_sip_fcs.c

index 3b0b37029d13e5582a9bf7b7a23f8bac205b076d..0166eb726f215f3c0c465574a0d62fe1fc790e69 100644 (file)
@@ -1269,7 +1269,7 @@ int intel_fcs_mac_verify_smmu_update_finalize(uint32_t session_id,
                memcpy((uint8_t *) &payload[i], (uint8_t *) mac_offset,
                src_size - data_size);
 
-               memset((void *)&dst_addr, 0, sizeof(dst_size));
+               memset((void *) dst_addr, 0, *dst_size);
 
                i += (src_size - data_size) / MBOX_WORD_BYTE;
        }
@@ -1874,7 +1874,7 @@ int intel_fcs_ecdsa_sha2_data_sig_verify_smmu_update_finalize(uint32_t session_i
                memcpy((uint8_t *) &payload[i], (uint8_t *) sig_pubkey_offset,
                        src_size - data_size);
 
-               memset((void *)&dst_addr, 0, sizeof(dst_size));
+               memset((void *) dst_addr, 0, *dst_size);
 
                i += (src_size - data_size) / MBOX_WORD_BYTE;
        }