[PATCH] KVM: x86: fix noderef.cocci warnings

From: kernel test robot
Date: Sat Nov 13 2021 - 21:00:13 EST


From: kernel test robot <lkp@xxxxxxxxx>

arch/x86/kvm/mmu/page_track.c:95:39-45: ERROR: application of sizeof to pointer

sizeof when applied to a pointer typed expression gives the size of
the pointer

Generated by: scripts/coccinelle/misc/noderef.cocci

CC: David Stevens <stevensd@xxxxxxxxxxxx>
Reported-by: kernel test robot <lkp@xxxxxxxxx>
Signed-off-by: kernel test robot <lkp@xxxxxxxxx>
---

tree: https://github.com/0day-ci/linux/commits/David-Stevens/KVM-x86-skip-gfn_track-allocation-when-possible/20210922-134429
head: e8c58ba667b80c8c238fb54320c7f774c631dfd5
commit: e8c58ba667b80c8c238fb54320c7f774c631dfd5 KVM: x86: only allocate gfn_track when necessary
:::::: branch date: 8 weeks ago
:::::: commit date: 8 weeks ago

page_track.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

--- a/arch/x86/kvm/mmu/page_track.c
+++ b/arch/x86/kvm/mmu/page_track.c
@@ -92,7 +92,8 @@ int kvm_page_track_enable_mmu_write_trac
slots = __kvm_memslots(kvm, i);
kvm_for_each_memslot(slot, slots) {
gfn_track = slot->arch.gfn_track + KVM_PAGE_TRACK_WRITE;
- *gfn_track = kvcalloc(slot->npages, sizeof(*gfn_track),
+ *gfn_track = kvcalloc(slot->npages,
+ sizeof(**gfn_track),
GFP_KERNEL_ACCOUNT);
if (*gfn_track == NULL) {
mutex_unlock(&kvm->slots_arch_lock);