diff mbox

[2/3] core/vpd: remove realloc

Message ID 1473041269-21797-2-git-send-email-oohall@gmail.com
State Accepted
Headers show

Commit Message

Oliver O'Halloran Sept. 5, 2016, 2:07 a.m. UTC
When setting up the VPD lid preload a buffer of VPD_LID_MAX_SIZE bytes
is allocated. Once the lid has been transferred from the FSP this buffer
is shrunk with realloc. However, the contents of the buffer are copied
into the devicetree and the buffer is freed making the shrinking
pointless.

Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
---
 core/vpd.c | 6 ------
 1 file changed, 6 deletions(-)
diff mbox

Patch

diff --git a/core/vpd.c b/core/vpd.c
index d706b5575fd7..050bd42f7482 100644
--- a/core/vpd.c
+++ b/core/vpd.c
@@ -217,12 +217,6 @@  void vpd_iohub_load(struct dt_node *hub_node)
 
 	printf("VPD: Loaded %zu bytes\n", vpd_size);
 
-	/* Got it ! */
-	vpd = realloc(vpd, vpd_size);
-
-	if (!vpd)
-		goto fail;
-
 	dt_add_property(hub_node, "ibm,io-vpd", vpd, vpd_size);
 	free(vpd);
 	return;