From: kernel test robot <lkp(a)intel.com>
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
Fixes: deae4a10f166 ("KVM: x86: only allocate gfn_track when necessary")
CC: David Stevens <stevensd(a)chromium.org>
Reported-by: kernel test robot <lkp(a)intel.com>
Signed-off-by: kernel test robot <lkp(a)intel.com>
---
tree:
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: 8006b911c90a4ec09958447d24c8a4c3538f5723
commit: deae4a10f16649d9c8bfb89f38b61930fb938284 [4556/7806] KVM: x86: only allocate
gfn_track when necessary
:::::: branch date: 3 hours ago
:::::: commit date: 12 days 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);