Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

KVM: guest_memfd: Drop a superfluous local var in kvm_gmem_fault_user_mapping()

Drop the local "int err" that's buried in the middle guest_memfd's user
fault handler to avoid the potential for variable shadowing, e.g. if an
"err" variable were also declared at function scope.

No functional change intended.

Link: https://lore.kernel.org/r/20251007222733.349460-1-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>

+2 -4
+2 -4
virt/kvm/guest_memfd.c
··· 361 361 362 362 folio = kvm_gmem_get_folio(inode, vmf->pgoff); 363 363 if (IS_ERR(folio)) { 364 - int err = PTR_ERR(folio); 365 - 366 - if (err == -EAGAIN) 364 + if (PTR_ERR(folio) == -EAGAIN) 367 365 return VM_FAULT_RETRY; 368 366 369 - return vmf_error(err); 367 + return vmf_error(PTR_ERR(folio)); 370 368 } 371 369 372 370 if (WARN_ON_ONCE(folio_test_large(folio))) {