From 1ced4e64b0b130708dbce6c406c7125f82c8e705 Mon Sep 17 00:00:00 2001 From: Paul Menzel Date: Sat, 15 Feb 2020 13:12:04 +0100 Subject: lib/edid: Zero struct only when used Change-Id: I1c14e7458153fb992b17f30d7015321fae533bb2 Signed-off-by: Paul Menzel Reviewed-on: https://review.coreboot.org/c/coreboot/+/38913 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi --- src/lib/edid.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/lib/edid.c b/src/lib/edid.c index 238fed56a0..048cc6ad5a 100644 --- a/src/lib/edid.c +++ b/src/lib/edid.c @@ -1138,8 +1138,6 @@ int decode_edid(unsigned char *edid, int size, struct edid *out) .conformant = EDID_CONFORMANT, }; - memset(out, 0, sizeof(*out)); - if (!edid) { printk(BIOS_ERR, "No EDID found\n"); return EDID_ABSENT; @@ -1152,6 +1150,8 @@ int decode_edid(unsigned char *edid, int size, struct edid *out) return EDID_ABSENT; } + memset(out, 0, sizeof(*out)); + if (manufacturer_name(edid + 0x08, out->manufacturer_name)) c.manufacturer_name_well_formed = 1; -- cgit v1.2.3