From 9b565de3a020106a3dc4bb0f1e23ad964974c4e9 Mon Sep 17 00:00:00 2001 From: Werner Zeh Date: Wed, 9 Mar 2022 08:17:54 +0100 Subject: [PATCH] lib/spd: Do not print part number if it is not available If the DRAM part number is not available in the SPD data (meaning filled with 0x00) do not print it in the log. Change-Id: If7224c6e114731b1c03915a2bde80f57369d0cee Signed-off-by: Werner Zeh Reviewed-on: https://review.coreboot.org/c/coreboot/+/62699 Tested-by: build bot (Jenkins) Reviewed-by: Subrata Banik Reviewed-by: Angel Pons --- src/lib/spd_bin.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/lib/spd_bin.c b/src/lib/spd_bin.c index 865f16cc8a..1b236b0e8f 100644 --- a/src/lib/spd_bin.c +++ b/src/lib/spd_bin.c @@ -167,8 +167,10 @@ static void spd_get_name(const uint8_t spd[], int type, const char **spd_name, s case SPD_DRAM_DDR5: case SPD_DRAM_LPDDR4: case SPD_DRAM_LPDDR4X: - *spd_name = (const char *) &spd[DDR4_SPD_PART_OFF]; - *len = DDR4_SPD_PART_LEN; + if (spd[DDR4_SPD_PART_OFF]) { + *spd_name = (const char *) &spd[DDR4_SPD_PART_OFF]; + *len = DDR4_SPD_PART_LEN; + } break; default: *len = 0;