lkml.org 
[lkml]   [2009]   [Jun]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Subject[PATCH]X86:microcode: fix vfree()
    From
    Date

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

    Signed-off-by: Figo.zhang <figo1802@gmail.com>
    ---
    arch/x86/kernel/microcode_amd.c | 13 +++++--------
    1 files changed, 5 insertions(+), 8 deletions(-)

    diff --git a/arch/x86/kernel/microcode_amd.c b/arch/x86/kernel/microcode_amd.c
    index 453b579..fe577fd 100644
    --- a/arch/x86/kernel/microcode_amd.c
    +++ b/arch/x86/kernel/microcode_amd.c
    @@ -257,10 +257,9 @@ static int install_equiv_cpu_table(const u8 *buf)

    static void free_equiv_cpu_table(void)
    {
    - if (equiv_cpu_table) {
    - vfree(equiv_cpu_table);
    - equiv_cpu_table = NULL;
    - }
    + vfree(equiv_cpu_table);
    + equiv_cpu_table = NULL;
    +
    }

    static int generic_load_microcode(int cpu, const u8 *data, size_t size)
    @@ -293,8 +292,7 @@ static int generic_load_microcode(int cpu, const u8 *data, size_t size)

    mc_header = (struct microcode_header_amd *)mc;
    if (get_matching_microcode(cpu, mc, new_rev)) {
    - if (new_mc)
    - vfree(new_mc);
    + vfree(new_mc);
    new_rev = mc_header->patch_id;
    new_mc = mc;
    } else
    @@ -306,8 +304,7 @@ static int generic_load_microcode(int cpu, const u8 *data, size_t size)

    if (new_mc) {
    if (!leftover) {
    - if (uci->mc)
    - vfree(uci->mc);
    + vfree(uci->mc);
    uci->mc = new_mc;
    pr_debug("microcode: CPU%d found a matching microcode "
    "update with version 0x%x (current=0x%x)\n",



    \
     
     \ /
      Last update: 2009-06-07 07:31    [W:0.025 / U:0.964 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site