[Skiboot] [PATCH 2/3] core/vpd: remove realloc

Oliver O'Halloran oohall at gmail.com
Mon Sep 5 12:07:48 AEST 2016


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 at gmail.com>
---
 core/vpd.c | 6 ------
 1 file changed, 6 deletions(-)

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;
-- 
2.5.5



More information about the Skiboot mailing list