[Pdbg] [PATCH] sbefifo: Memory size for sbefifo ops must be 4-byte aligned

Amitay Isaacs amitay at ozlabs.org
Fri Aug 2 12:26:17 AEST 2019


Signed-off-by: Amitay Isaacs <amitay at ozlabs.org>
---
 libpdbg/sbefifo.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libpdbg/sbefifo.c b/libpdbg/sbefifo.c
index a2442cd..c251089 100644
--- a/libpdbg/sbefifo.c
+++ b/libpdbg/sbefifo.c
@@ -146,7 +146,7 @@ static int sbefifo_op(struct sbefifo *sbefifo,
 	 * Allocate extra memory for FFDC (SBEFIFO_MAX_FFDC_SIZE = 0x2000)
 	 * Use *out_len as a hint to expected reply length
 	 */
-	buflen = *out_len + 0x2000 ;
+	buflen = (*out_len + 0x2000 + 3) & (uint32_t)~3;
 	buf = malloc(buflen);
 	assert(buf);
 
-- 
2.21.0



More information about the Pdbg mailing list