Skip to content

Commit

Permalink
KVM-async_pf: Delete an unnecessary check before the function call "k…
Browse files Browse the repository at this point in the history
…mem_cache_destroy"

The kmem_cache_destroy() function tests whether its argument is NULL
and then returns immediately. Thus the test around the call is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
  • Loading branch information
elfring authored and bonzini committed Nov 25, 2015
1 parent 0e3d064 commit 4f52696
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions virt/kvm/async_pf.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,7 @@ int kvm_async_pf_init(void)

void kvm_async_pf_deinit(void)
{
if (async_pf_cache)
kmem_cache_destroy(async_pf_cache);
kmem_cache_destroy(async_pf_cache);
async_pf_cache = NULL;
}

Expand Down

0 comments on commit 4f52696

Please sign in to comment.