diff options
author | Werner Zeh <werner.zeh@siemens.com> | 2022-03-09 08:17:54 +0100 |
---|---|---|
committer | Felix Held <felix-coreboot@felixheld.de> | 2022-03-15 19:18:54 +0000 |
commit | 9b565de3a020106a3dc4bb0f1e23ad964974c4e9 (patch) | |
tree | b5826993ed885406954eea6d78a0a3cecbfc78a7 /src | |
parent | 69e3cab7f991acab18a0b39e74a7dbe0c8d26168 (diff) |
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 <werner.zeh@siemens.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/62699
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Subrata Banik <subratabanik@google.com>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/spd_bin.c | 6 |
1 files 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; |