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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 13/10/21 11:08, kernel test robot wrote:
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

Fixes: deae4a10f166 ("KVM: x86: only allocate gfn_track when necessary")
CC: David Stevens <stevensd@xxxxxxxxxxxx>
Reported-by: kernel test robot <lkp@xxxxxxxxx>
Signed-off-by: kernel test robot <lkp@xxxxxxxxx>
---

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);


There's already a patch on list here, I should apply it soon.

Paolo





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux