From: kernel test robot <lkp@intel.com>
To: "Mike Rapoport (Microsoft)" <rppt@kernel.org>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev
Subject: [rppt:uffd/refactor/v0.2 8/11] mm/userfaultfd.c:589:7: warning: variable 'ret' is uninitialized when used here
Date: Mon, 19 Jan 2026 08:49:16 +0800 [thread overview]
Message-ID: <202601190850.lPsTWmiG-lkp@intel.com> (raw)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/rppt/linux.git uffd/refactor/v0.2
head: 2db3a86a6de3247449e068d998305d26481c5522
commit: 629131e835ff52775f59108aa49795ce35e442d4 [8/11] userfaultfd, shmem: use a VMA callback to handle UFFDIO_CONTINUE
config: x86_64-randconfig-016-20260119 (https://download.01.org/0day-ci/archive/20260119/202601190850.lPsTWmiG-lkp@intel.com/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260119/202601190850.lPsTWmiG-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202601190850.lPsTWmiG-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> mm/userfaultfd.c:589:7: warning: variable 'ret' is uninitialized when used here [-Wuninitialized]
589 | if (ret == -ENOENT || !folio)
| ^~~
mm/userfaultfd.c:581:9: note: initialize the variable 'ret' to silence this warning
581 | int ret;
| ^
| = 0
1 warning generated.
vim +/ret +589 mm/userfaultfd.c
568
569 /* Handles UFFDIO_CONTINUE for all shmem VMAs (shared or private). */
570 static int mfill_atomic_pte_continue(struct mfill_state *state)
571 {
572 struct vm_area_struct *dst_vma = state->vma;
573 const struct vm_uffd_ops *ops = vma_uffd_ops(dst_vma);
574 unsigned long dst_addr = state->dst_addr;
575 pgoff_t pgoff = linear_page_index(dst_vma, dst_addr);
576 struct inode *inode = file_inode(dst_vma->vm_file);
577 uffd_flags_t flags = state->flags;
578 pmd_t *dst_pmd = state->pmd;
579 struct folio *folio;
580 struct page *page;
581 int ret;
582
583 if (!ops)
584 return -EOPNOTSUPP;
585
586 folio = ops->get_folio_noalloc(inode, pgoff);
587 /* Our caller expects us to return -EFAULT if we failed to find folio */
588 if (IS_ERR_OR_NULL(folio)) {
> 589 if (ret == -ENOENT || !folio)
590 ret = -EFAULT;
591 return -EFAULT;
592 }
593
594 page = folio_file_page(folio, pgoff);
595 if (PageHWPoison(page)) {
596 ret = -EIO;
597 goto out_release;
598 }
599
600 ret = mfill_atomic_install_pte(dst_pmd, dst_vma, dst_addr,
601 page, false, flags);
602 if (ret)
603 goto out_release;
604
605 folio_unlock(folio);
606 return 0;
607
608 out_release:
609 folio_unlock(folio);
610 folio_put(folio);
611 return ret;
612 }
613
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2026-01-19 0:49 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202601190850.lPsTWmiG-lkp@intel.com \
--to=lkp@intel.com \
--cc=llvm@lists.linux.dev \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=rppt@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox