aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndi Kleen <ak@linux.intel.com>2009-07-08 12:21:20 +0200
committerAndi Kleen <ak@linux.intel.com>2009-07-08 12:21:20 +0200
commit3fd28add5ee7b3f30c95ae6b610043b28c6c1cbd (patch)
tree266516171d113e28ef690da07e7efe14eaa23838
parente6146c645b199700dab4f338aeee1de47aa3b7ab (diff)
downloadmce-inject-3fd28add5ee7b3f30c95ae6b610043b28c6c1cbd.tar.gz
Remove redundant NULL checks before free
Signed-off-by: Andi Kleen <ak@linux.intel.com>
-rw-r--r--mce-inject.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/mce-inject.c b/mce-inject.c
index bb06681..6ec168f 100644
--- a/mce-inject.c
+++ b/mce-inject.c
@@ -69,10 +69,8 @@ void init_inject(void)
void clean_inject(void)
{
- if (cpu_mce)
- free(cpu_mce);
- if (cpu_map)
- free(cpu_map);
+ free(cpu_mce);
+ free(cpu_map);
}
static inline int cpu_id_to_index(int id)
@@ -214,8 +212,7 @@ void inject_mce(struct mce *m)
NEW(nm);
*nm = *m;
- if (cpu_mce[cpu_index])
- free(cpu_mce[cpu_index]);
+ free(cpu_mce[cpu_index]);
cpu_mce[cpu_index] = nm;
return;
}