edid: Memset output earlier in decode_edid()

This ensures the output buffer is initialized before exiting
decode_edid() so that if the return value is ignored in higher-level
logic (like when dealing with external displays) we don't leave
the struct filled with garbage.

BUG=chrome-os-partner:42946
BRANCH=firmware-veyron
TEST=none

Change-Id: I697436fffadc7dd3af239436061975165a97ec8c
Signed-off-by: David Hendricks <dhendrix@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/293607
This commit is contained in:
David Hendricks 2015-08-13 15:51:00 -07:00 committed by ChromeOS Commit Bot
commit 7c433aab45

View file

@ -1048,12 +1048,13 @@ int decode_edid(unsigned char *edid, int size, struct edid *out)
dump_breakdown(edid);
memset(out, 0, sizeof(*out));
if (!edid || memcmp(edid, "\x00\xFF\xFF\xFF\xFF\xFF\xFF\x00", 8)) {
printk(BIOS_SPEW, "No header found\n");
return 1;
}
memset(out, 0, sizeof(*out));
if (manufacturer_name(edid + 0x08))
c.manufacturer_name_well_formed = 1;