summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPaul Menzel <pmenzel@molgen.mpg.de>2020-02-15 13:12:04 +0100
committerPatrick Georgi <pgeorgi@google.com>2020-02-17 15:43:25 +0000
commit1ced4e64b0b130708dbce6c406c7125f82c8e705 (patch)
treedfe029e26ba5ae2eef2440b0cc9427d8558bfe85 /src
parent433bf770fc62fe8646b5a0ea795d381e28ec19f6 (diff)
downloadcoreboot-1ced4e64b0b130708dbce6c406c7125f82c8e705.tar.xz
lib/edid: Zero struct only when used
Change-Id: I1c14e7458153fb992b17f30d7015321fae533bb2 Signed-off-by: Paul Menzel <pmenzel@molgen.mpg.de> Reviewed-on: https://review.coreboot.org/c/coreboot/+/38913 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Diffstat (limited to 'src')
-rw-r--r--src/lib/edid.c4
1 files changed, 2 insertions, 2 deletions
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;