x86, microcode: Simplify vfree() use

vfree() does its own 'NULL' check, so no need for check before
calling it.

In v2, remove the stray newline.

[ Impact: cleanup ]

Signed-off-by: Figo.zhang <figo1802@gmail.com>
Cc: Dmitry Adamushko <dmitry.adamushko@gmail.com>
LKML-Reference: <1244385036.3402.11.camel@myhost>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
This commit is contained in:
Figo.zhang
2009-06-07 22:30:36 +08:00
committed by Ingo Molnar
parent 871b72dd1e
commit aeef50bc04

View File

@@ -241,11 +241,9 @@ static int install_equiv_cpu_table(const u8 *buf)
static void free_equiv_cpu_table(void) static void free_equiv_cpu_table(void)
{ {
if (equiv_cpu_table) {
vfree(equiv_cpu_table); vfree(equiv_cpu_table);
equiv_cpu_table = NULL; equiv_cpu_table = NULL;
} }
}
static enum ucode_state static enum ucode_state
generic_load_microcode(int cpu, const u8 *data, size_t size) generic_load_microcode(int cpu, const u8 *data, size_t size)
@@ -279,7 +277,6 @@ generic_load_microcode(int cpu, const u8 *data, size_t size)
mc_header = (struct microcode_header_amd *)mc; mc_header = (struct microcode_header_amd *)mc;
if (get_matching_microcode(cpu, mc, new_rev)) { if (get_matching_microcode(cpu, mc, new_rev)) {
if (new_mc)
vfree(new_mc); vfree(new_mc);
new_rev = mc_header->patch_id; new_rev = mc_header->patch_id;
new_mc = mc; new_mc = mc;
@@ -292,7 +289,6 @@ generic_load_microcode(int cpu, const u8 *data, size_t size)
if (new_mc) { if (new_mc) {
if (!leftover) { if (!leftover) {
if (uci->mc)
vfree(uci->mc); vfree(uci->mc);
uci->mc = new_mc; uci->mc = new_mc;
pr_debug("microcode: CPU%d found a matching microcode " pr_debug("microcode: CPU%d found a matching microcode "