[PATCH] cpu: nx: free fwts_nx_cpuinfo on error

Colin King colin.king at canonical.com
Mon May 6 22:09:35 UTC 2013


From: Colin Ian King <colin.king at canonical.com>

Coverity CID #997349, Resource leak.

Need to free fwts_nx_cpuinfo before we return.

Signed-off-by: Colin Ian King <colin.king at canonical.com>
---
 src/cpu/nx/nx.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/cpu/nx/nx.c b/src/cpu/nx/nx.c
index 66ff2b9..9cf1da9 100644
--- a/src/cpu/nx/nx.c
+++ b/src/cpu/nx/nx.c
@@ -153,6 +153,7 @@ static int nx_test3(fwts_framework *fw)
 		}
 		if (fwts_cpu_readmsr(i, 0x1a0, &val) != FWTS_OK) {
 			fwts_log_error(fw, "Cannot read msr 0x1a0 on CPU%d", i);
+			fwts_cpu_free_info(fwts_nx_cpuinfo);
 			return FWTS_ERROR;
 		}
 		if (i == 0) {
-- 
1.8.1.2




More information about the fwts-devel mailing list