OSDN Git Service

x86: kvm: remove NULL check before kfree
authorDongliang Mu <mudongliangabcd@gmail.com>
Tue, 14 Jun 2022 13:34:58 +0000 (21:34 +0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 20 Jun 2022 10:22:04 +0000 (06:22 -0400)
kfree can handle NULL pointer as its argument.
According to coccinelle isnullfree check, remove NULL check
before kfree operation.

Signed-off-by: Dongliang Mu <mudongliangabcd@gmail.com>
Message-Id: <20220614133458.147314-1-dzm91@hust.edu.cn>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kernel/kvm.c

index 1a3658f..d4e48b4 100644 (file)
@@ -236,8 +236,7 @@ again:
        raw_spin_unlock(&b->lock);
 
        /* A dummy token might be allocated and ultimately not used.  */
-       if (dummy)
-               kfree(dummy);
+       kfree(dummy);
 }
 EXPORT_SYMBOL_GPL(kvm_async_pf_task_wake);