[coreboot-gerrit] Change in coreboot[master]: drivers/intel/gma: Allocate vbt_data on heap instead of .bss

Subrata Banik (Code Review) gerrit at coreboot.org
Thu May 10 14:01:34 CEST 2018


Subrata Banik has uploaded this change for review. ( https://review.coreboot.org/26215


Change subject: drivers/intel/gma: Allocate vbt_data on heap instead of .bss
......................................................................

drivers/intel/gma: Allocate vbt_data on heap instead of .bss

TEST=Display in working find on KBL platform.

Change-Id: Iac5d52847389298f48baaf497e9bf5dff18175c7
Signed-off-by: Subrata Banik <subrata.banik at intel.com>
---
M src/drivers/intel/gma/opregion.c
1 file changed, 6 insertions(+), 2 deletions(-)



  git pull ssh://review.coreboot.org:29418/coreboot refs/changes/15/26215/1

diff --git a/src/drivers/intel/gma/opregion.c b/src/drivers/intel/gma/opregion.c
index c52c06f1..6fe03f6 100644
--- a/src/drivers/intel/gma/opregion.c
+++ b/src/drivers/intel/gma/opregion.c
@@ -33,12 +33,16 @@
 	return "vbt.bin";
 }
 
-static char vbt_data[8 * KiB];
 static int vbt_data_used;
 
 void *locate_vbt(size_t *vbt_size)
 {
 	uint32_t vbtsig = 0;
+	size_t length = 8 * KiB;
+	char *vbt_data = malloc(length);
+
+	if (!vbt_data)
+		return NULL;
 
 	if (vbt_data_used == 1)
 		return (void *)vbt_data;
@@ -46,7 +50,7 @@
 	const char *filename = mainboard_vbt_filename();
 
 	size_t file_size = cbfs_boot_load_file(filename,
-		vbt_data, sizeof(vbt_data), CBFS_TYPE_RAW);
+		vbt_data, length, CBFS_TYPE_RAW);
 
 	if (file_size == 0)
 		return NULL;

-- 
To view, visit https://review.coreboot.org/26215
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iac5d52847389298f48baaf497e9bf5dff18175c7
Gerrit-Change-Number: 26215
Gerrit-PatchSet: 1
Gerrit-Owner: Subrata Banik <subrata.banik at intel.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20180510/0e594ff5/attachment.html>


More information about the coreboot-gerrit mailing list