summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKamalesh Babulal <kamalesh@linux.vnet.ibm.com>2015-07-09 15:10:33 +0530
committerStewart Smith <stewart@linux.vnet.ibm.com>2015-07-10 13:48:16 +1000
commitefebe9cf61ebf08974cc52c8927d2356d2d0fda3 (patch)
tree2371c3265f1cf000b3b70566add170ea8b1ccba3
parentbb57777a2bf341bec6825adbc03a4c67bbcd7398 (diff)
downloadtalos-skiboot-efebe9cf61ebf08974cc52c8927d2356d2d0fda3.tar.gz
talos-skiboot-efebe9cf61ebf08974cc52c8927d2356d2d0fda3.zip
fsp_create_node(): Fix resource leak
Fix memory leak by free-ing 'links'. Also, fix trailing white spaces. Fixes Coverity defect#98816. Signed-off-by: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
-rw-r--r--hdata/fsp.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/hdata/fsp.c b/hdata/fsp.c
index 15cc6110..595e1f8b 100644
--- a/hdata/fsp.c
+++ b/hdata/fsp.c
@@ -154,6 +154,8 @@ static void fsp_create_links(const void *spss, int index,
}
if (links)
dt_add_property(fsp_node, "ibm,psi-links", links, lcount * 4);
+
+ free(links);
}
void fsp_parse(void)
@@ -177,7 +179,7 @@ void fsp_parse(void)
*
* Each FSP then has a "links" property which is an array of chip IDs
*/
-
+
/* Find SPSS in SPIRA */
base_spss = get_hdif(&spira.ntuples.sp_subsys, SPSS_HDIF_SIG);
if (!base_spss) {
@@ -195,6 +197,6 @@ void fsp_parse(void)
fsp_node = fsp_create_node(spss, i, fsp_root);
if (fsp_node)
fsp_create_links(spss, i, fsp_node);
- }
+ }
}
OpenPOWER on IntegriCloud