summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Crowell <dcrowell@us.ibm.com>2013-01-08 16:48:35 -0600
committerA. Patrick Williams III <iawillia@us.ibm.com>2013-01-14 13:16:39 -0600
commit5d8c171a73dbbdc99558e095ab5697aeff454293 (patch)
treeb0bfd9ef5140e2466a51fa6d20df77de2c23fc8d
parent8f5691c57fc23091e58089e457719991d12cc090 (diff)
downloadtalos-hostboot-5d8c171a73dbbdc99558e095ab5697aeff454293.tar.gz
talos-hostboot-5d8c171a73dbbdc99558e095ab5697aeff454293.zip
Fix memory leak in spd testcase
Change-Id: I1f597da34ae6b3e4c3bf03492d25a90e985ad927 RTC: 47487 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/2887 Tested-by: Jenkins Server Reviewed-by: ADAM R. MUHLE <armuhle@us.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
-rwxr-xr-xsrc/usr/spd/test/spdtest.H71
1 files changed, 44 insertions, 27 deletions
diff --git a/src/usr/spd/test/spdtest.H b/src/usr/spd/test/spdtest.H
index a437900a5..a2d8f765d 100755
--- a/src/usr/spd/test/spdtest.H
+++ b/src/usr/spd/test/spdtest.H
@@ -1,26 +1,25 @@
-/* IBM_PROLOG_BEGIN_TAG
- * This is an automatically generated prolog.
- *
- * $Source: src/usr/spd/test/spdtest.H $
- *
- * IBM CONFIDENTIAL
- *
- * COPYRIGHT International Business Machines Corp. 2012
- *
- * p1
- *
- * Object Code Only (OCO) source materials
- * Licensed Internal Code Source Materials
- * IBM HostBoot Licensed Internal Code
- *
- * The source code for this program is not published or other-
- * wise divested of its trade secrets, irrespective of what has
- * been deposited with the U.S. Copyright Office.
- *
- * Origin: 30
- *
- * IBM_PROLOG_END_TAG
- */
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/usr/spd/test/spdtest.H $ */
+/* */
+/* IBM CONFIDENTIAL */
+/* */
+/* COPYRIGHT International Business Machines Corp. 2012,2013 */
+/* */
+/* p1 */
+/* */
+/* Object Code Only (OCO) source materials */
+/* Licensed Internal Code Source Materials */
+/* IBM HostBoot Licensed Internal Code */
+/* */
+/* The source code for this program is not published or otherwise */
+/* divested of its trade secrets, irrespective of what has been */
+/* deposited with the U.S. Copyright Office. */
+/* */
+/* Origin: 30 */
+/* */
+/* IBM_PROLOG_END_TAG */
#ifndef __SPDTEST_H
#define __SPDTEST_H
@@ -85,6 +84,7 @@ class SPDTest: public CxxTest::TestSuite
errlHndl_t err = NULL;
uint64_t cmds = 0x0;
uint64_t fails = 0x0;
+ uint8_t * theData = NULL;
TRACFCOMP( g_trac_spd,
ENTER_MRK"testSpdRead()" );
@@ -107,7 +107,6 @@ class SPDTest: public CxxTest::TestSuite
// Operate on first DIMM.
theTarget = dimmList[0];
- uint8_t * theData = NULL;
size_t theSize = 0;
uint32_t entry = 0x0;
@@ -202,6 +201,12 @@ class SPDTest: public CxxTest::TestSuite
}
} while( 0 );
+ if( NULL != theData )
+ {
+ free( theData );
+ theData = NULL;
+ }
+
TRACFCOMP( g_trac_spd,
"testSpdRead - %d/%d fails",
fails, cmds );
@@ -215,6 +220,7 @@ class SPDTest: public CxxTest::TestSuite
errlHndl_t err = NULL;
uint64_t cmds = 0x0;
uint64_t fails = 0x0;
+ uint8_t * theData = NULL;
TRACFCOMP( g_trac_spd,
ENTER_MRK"testSpdWrite()" );
@@ -238,7 +244,6 @@ class SPDTest: public CxxTest::TestSuite
// Operate on first DIMM
cmds++;
theTarget = dimmList[0];
- uint8_t * theData = NULL;
size_t theSize = 0;
// Get Memory Type
@@ -320,6 +325,12 @@ class SPDTest: public CxxTest::TestSuite
}
} while( 0 );
+ if( NULL != theData )
+ {
+ free( theData );
+ theData = NULL;
+ }
+
TRACFCOMP( g_trac_spd,
"testSpdWrite - %d/%d fails",
fails, cmds );
@@ -497,7 +508,7 @@ class SPDTest: public CxxTest::TestSuite
err = NULL;
}
} while( 0 );
-
+
TRACFCOMP( g_trac_spd,
"testSpdInvalidWrite - %d/%d fails",
fails, cmds );
@@ -514,6 +525,7 @@ class SPDTest: public CxxTest::TestSuite
uint64_t fails = 0x0;
uint8_t memType = 0x0;
uint8_t modType = 0x0;
+ uint8_t * theData = NULL;
TRACFCOMP( g_trac_spd,
ENTER_MRK"testspdDDR3ModSpecKwds()" );
@@ -536,7 +548,6 @@ class SPDTest: public CxxTest::TestSuite
// Operate on first DIMM.
theTarget = dimmList[0];
- uint8_t * theData = NULL;
size_t theSize = 0;
uint32_t entry = 0x0;
@@ -669,6 +680,12 @@ class SPDTest: public CxxTest::TestSuite
}
} while( 0 );
+ if( NULL != theData )
+ {
+ free( theData );
+ theData = NULL;
+ }
+
TRACFCOMP( g_trac_spd,
"testspdDDR3ModSpecKwds - %d/%d fails",
fails, cmds );
OpenPOWER on IntegriCloud