[PATCH 1/4] fru: ops: Clear fru table before storing data

Michal Simek michal.simek at xilinx.com
Wed Feb 23 15:00:56 CET 2022


From: Ashok Reddy Soma <ashok.reddy.soma at xilinx.com>

Fill fru table with 0's before using it, to avoid junk data.

Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma at xilinx.com>
Signed-off-by: Michal Simek <michal.simek at xilinx.com>
---

 board/xilinx/common/fru_ops.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/board/xilinx/common/fru_ops.c b/board/xilinx/common/fru_ops.c
index 6ed63bb7ee11..a0a1441a8eef 100644
--- a/board/xilinx/common/fru_ops.c
+++ b/board/xilinx/common/fru_ops.c
@@ -222,7 +222,7 @@ int fru_capture(unsigned long addr)
 	}
 
 	hdr = (struct fru_common_hdr *)addr;
-
+	memset((void *)&fru_data, 0, sizeof(fru_data));
 	memcpy((void *)&fru_data, (void *)hdr,
 	       sizeof(struct fru_common_hdr));
 
-- 
2.35.1



More information about the U-Boot mailing list