From 7309c64d483abb4bf4ebe12901109320d88124ba Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Sun, 5 Oct 2014 11:07:33 +0200 Subject: bd82x6x, ibexpeak, lynxpoint: Ensure 0-filling of uninited GNVS vars. Change-Id: I672c3ca9e7f30a21330cf1920a25b1ab38b3f282 Signed-off-by: Vladimir Serbinenko Reviewed-on: http://review.coreboot.org/7015 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin --- src/southbridge/intel/lynxpoint/lpc.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/southbridge/intel/lynxpoint') diff --git a/src/southbridge/intel/lynxpoint/lpc.c b/src/southbridge/intel/lynxpoint/lpc.c index d1a7203041..451aeabc2e 100644 --- a/src/southbridge/intel/lynxpoint/lpc.c +++ b/src/southbridge/intel/lynxpoint/lpc.c @@ -745,7 +745,14 @@ static void set_subsystem(device_t dev, unsigned vendor, unsigned device) static unsigned long southbridge_fill_ssdt(unsigned long current, const char *oem_table_id) { - global_nvs_t *gnvs = cbmem_add (CBMEM_ID_ACPI_GNVS, sizeof (*gnvs)); + global_nvs_t *gnvs; + + gnvs = cbmem_find(CBMEM_ID_ACPI_GNVS); + if (!gnvs) { + gnvs = cbmem_add(CBMEM_ID_ACPI_GNVS, sizeof (*gnvs)); + if (gnvs) + memset(gnvs, 0, sizeof(*gnvs)); + } if (gnvs) { int scopelen; -- cgit v1.2.3