fix(systembus): align data length to prevent unaligned memory copy operations
This commit is contained in:
@@ -175,7 +175,7 @@ int SysbusUart_Recv(SYSBUS_UART *instPtr, SYSBUS_UART_FRAME *frame)
|
|||||||
{
|
{
|
||||||
return EPARAM;
|
return EPARAM;
|
||||||
}
|
}
|
||||||
dWLen = (dLen + FRAME_HEAD_LEN + FRAME_INFO_LEN - 1) / 4 + 1;
|
dWLen = NORMALIZE_SIZE(dLen + FRAME_HEAD_LEN + FRAME_INFO_LEN) / sizeof(uint32_t);
|
||||||
|
|
||||||
dBuff = malloc(sizeof(uint32_t) * dWLen);
|
dBuff = malloc(sizeof(uint32_t) * dWLen);
|
||||||
if (dBuff == NULL)
|
if (dBuff == NULL)
|
||||||
@@ -262,4 +262,4 @@ bool SysbusUart_IsTxBusy(SYSBUS_UART *instPtr)
|
|||||||
|
|
||||||
/** @} SystemBus_UART*/
|
/** @} SystemBus_UART*/
|
||||||
|
|
||||||
/** @} SystemBus*/
|
/** @} SystemBus*/
|
||||||
|
|||||||
Reference in New Issue
Block a user