lkml.org 
[lkml]   [2021]   [Nov]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] KVM: x86: fix noderef.cocci warnings
From: kernel test robot <lkp@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

CC: David Stevens <stevensd@chromium.org>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

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);
\
 
 \ /
  Last update: 2021-11-14 03:00    [W:0.025 / U:0.304 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site