* [android-common:android12-5.4 5/5] mm/memory.c:1807:22: warning: variable 'mapped_pte' set but not used
@ 2025-11-25 0:18 kernel test robot
0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2025-11-25 0:18 UTC (permalink / raw)
To: oe-kbuild; +Cc: lkp
::::::
:::::: Manual check reason: "low confidence bisect report"
::::::
BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
TO: cros-kernel-buildreports@googlegroups.com
tree: https://android.googlesource.com/kernel/common android12-5.4
head: 7055541caeda53d6275f23b878618d609132e955
commit: 67a982ee20d20e112f15eff98592a718de7c652e [5/5] mm/memory.c: fix potential pte_unmap_unlock pte error
:::::: branch date: 14 hours ago
:::::: commit date: 4 years, 9 months ago
config: i386-allnoconfig-bpf (https://download.01.org/0day-ci/archive/20251125/202511250100.9VNeAX9M-lkp@intel.com/config)
compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251125/202511250100.9VNeAX9M-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/r/202511250100.9VNeAX9M-lkp@intel.com/
All warnings (new ones prefixed by >>):
mm/memory.c: In function 'copy_pte_range':
mm/memory.c:800:31: warning: variable 'orig_dst_pte' set but not used [-Wunused-but-set-variable]
800 | pte_t *orig_src_pte, *orig_dst_pte;
| ^~~~~~~~~~~~
mm/memory.c:800:16: warning: variable 'orig_src_pte' set but not used [-Wunused-but-set-variable]
800 | pte_t *orig_src_pte, *orig_dst_pte;
| ^~~~~~~~~~~~
mm/memory.c: In function 'remap_pte_range':
>> mm/memory.c:1807:22: warning: variable 'mapped_pte' set but not used [-Wunused-but-set-variable]
1807 | pte_t *pte, *mapped_pte;
| ^~~~~~~~~~
vim +/mapped_pte +1807 mm/memory.c
b2770da6425406 Ross Zwisler 2017-09-06 1797
^1da177e4c3f41 Linus Torvalds 2005-04-16 1798 /*
^1da177e4c3f41 Linus Torvalds 2005-04-16 1799 * maps a range of physical memory into the requested pages. the old
^1da177e4c3f41 Linus Torvalds 2005-04-16 1800 * mappings are removed. any references to nonexistent pages results
^1da177e4c3f41 Linus Torvalds 2005-04-16 1801 * in null mappings (currently treated as "copy-on-access")
^1da177e4c3f41 Linus Torvalds 2005-04-16 1802 */
^1da177e4c3f41 Linus Torvalds 2005-04-16 1803 static int remap_pte_range(struct mm_struct *mm, pmd_t *pmd,
^1da177e4c3f41 Linus Torvalds 2005-04-16 1804 unsigned long addr, unsigned long end,
^1da177e4c3f41 Linus Torvalds 2005-04-16 1805 unsigned long pfn, pgprot_t prot)
^1da177e4c3f41 Linus Torvalds 2005-04-16 1806 {
67a982ee20d20e Miaohe Lin 2021-02-24 @1807 pte_t *pte, *mapped_pte;
c74df32c724a16 Hugh Dickins 2005-10-29 1808 spinlock_t *ptl;
42e4089c789072 Andi Kleen 2018-06-13 1809 int err = 0;
^1da177e4c3f41 Linus Torvalds 2005-04-16 1810
67a982ee20d20e Miaohe Lin 2021-02-24 1811 mapped_pte = pte = pte_alloc_map_lock(mm, pmd, addr, &ptl);
^1da177e4c3f41 Linus Torvalds 2005-04-16 1812 if (!pte)
^1da177e4c3f41 Linus Torvalds 2005-04-16 1813 return -ENOMEM;
6606c3e0da5360 Zachary Amsden 2006-09-30 1814 arch_enter_lazy_mmu_mode();
^1da177e4c3f41 Linus Torvalds 2005-04-16 1815 do {
^1da177e4c3f41 Linus Torvalds 2005-04-16 1816 BUG_ON(!pte_none(*pte));
42e4089c789072 Andi Kleen 2018-06-13 1817 if (!pfn_modify_allowed(pfn, prot)) {
42e4089c789072 Andi Kleen 2018-06-13 1818 err = -EACCES;
42e4089c789072 Andi Kleen 2018-06-13 1819 break;
42e4089c789072 Andi Kleen 2018-06-13 1820 }
7e675137a8e1a4 Nick Piggin 2008-04-28 1821 set_pte_at(mm, addr, pte, pte_mkspecial(pfn_pte(pfn, prot)));
^1da177e4c3f41 Linus Torvalds 2005-04-16 1822 pfn++;
^1da177e4c3f41 Linus Torvalds 2005-04-16 1823 } while (pte++, addr += PAGE_SIZE, addr != end);
6606c3e0da5360 Zachary Amsden 2006-09-30 1824 arch_leave_lazy_mmu_mode();
67a982ee20d20e Miaohe Lin 2021-02-24 1825 pte_unmap_unlock(mapped_pte, ptl);
42e4089c789072 Andi Kleen 2018-06-13 1826 return err;
^1da177e4c3f41 Linus Torvalds 2005-04-16 1827 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 1828
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 2+ messages in thread* [android-common:android12-5.4 5/5] mm/memory.c:1807:22: warning: variable 'mapped_pte' set but not used
@ 2025-11-25 2:26 kernel test robot
0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2025-11-25 2:26 UTC (permalink / raw)
To: cros-kernel-buildreports; +Cc: oe-kbuild-all
tree: https://android.googlesource.com/kernel/common android12-5.4
head: 7055541caeda53d6275f23b878618d609132e955
commit: 67a982ee20d20e112f15eff98592a718de7c652e [5/5] mm/memory.c: fix potential pte_unmap_unlock pte error
:::::: branch date: 14 hours ago
:::::: commit date: 4 years, 9 months ago
config: i386-allnoconfig-bpf (https://download.01.org/0day-ci/archive/20251125/202511250100.9VNeAX9M-lkp@intel.com/config)
compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251125/202511250100.9VNeAX9M-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/r/202511250100.9VNeAX9M-lkp@intel.com/
All warnings (new ones prefixed by >>):
mm/memory.c: In function 'copy_pte_range':
mm/memory.c:800:31: warning: variable 'orig_dst_pte' set but not used [-Wunused-but-set-variable]
800 | pte_t *orig_src_pte, *orig_dst_pte;
| ^~~~~~~~~~~~
mm/memory.c:800:16: warning: variable 'orig_src_pte' set but not used [-Wunused-but-set-variable]
800 | pte_t *orig_src_pte, *orig_dst_pte;
| ^~~~~~~~~~~~
mm/memory.c: In function 'remap_pte_range':
>> mm/memory.c:1807:22: warning: variable 'mapped_pte' set but not used [-Wunused-but-set-variable]
1807 | pte_t *pte, *mapped_pte;
| ^~~~~~~~~~
vim +/mapped_pte +1807 mm/memory.c
b2770da6425406 Ross Zwisler 2017-09-06 1797
^1da177e4c3f41 Linus Torvalds 2005-04-16 1798 /*
^1da177e4c3f41 Linus Torvalds 2005-04-16 1799 * maps a range of physical memory into the requested pages. the old
^1da177e4c3f41 Linus Torvalds 2005-04-16 1800 * mappings are removed. any references to nonexistent pages results
^1da177e4c3f41 Linus Torvalds 2005-04-16 1801 * in null mappings (currently treated as "copy-on-access")
^1da177e4c3f41 Linus Torvalds 2005-04-16 1802 */
^1da177e4c3f41 Linus Torvalds 2005-04-16 1803 static int remap_pte_range(struct mm_struct *mm, pmd_t *pmd,
^1da177e4c3f41 Linus Torvalds 2005-04-16 1804 unsigned long addr, unsigned long end,
^1da177e4c3f41 Linus Torvalds 2005-04-16 1805 unsigned long pfn, pgprot_t prot)
^1da177e4c3f41 Linus Torvalds 2005-04-16 1806 {
67a982ee20d20e Miaohe Lin 2021-02-24 @1807 pte_t *pte, *mapped_pte;
c74df32c724a16 Hugh Dickins 2005-10-29 1808 spinlock_t *ptl;
42e4089c789072 Andi Kleen 2018-06-13 1809 int err = 0;
^1da177e4c3f41 Linus Torvalds 2005-04-16 1810
67a982ee20d20e Miaohe Lin 2021-02-24 1811 mapped_pte = pte = pte_alloc_map_lock(mm, pmd, addr, &ptl);
^1da177e4c3f41 Linus Torvalds 2005-04-16 1812 if (!pte)
^1da177e4c3f41 Linus Torvalds 2005-04-16 1813 return -ENOMEM;
6606c3e0da5360 Zachary Amsden 2006-09-30 1814 arch_enter_lazy_mmu_mode();
^1da177e4c3f41 Linus Torvalds 2005-04-16 1815 do {
^1da177e4c3f41 Linus Torvalds 2005-04-16 1816 BUG_ON(!pte_none(*pte));
42e4089c789072 Andi Kleen 2018-06-13 1817 if (!pfn_modify_allowed(pfn, prot)) {
42e4089c789072 Andi Kleen 2018-06-13 1818 err = -EACCES;
42e4089c789072 Andi Kleen 2018-06-13 1819 break;
42e4089c789072 Andi Kleen 2018-06-13 1820 }
7e675137a8e1a4 Nick Piggin 2008-04-28 1821 set_pte_at(mm, addr, pte, pte_mkspecial(pfn_pte(pfn, prot)));
^1da177e4c3f41 Linus Torvalds 2005-04-16 1822 pfn++;
^1da177e4c3f41 Linus Torvalds 2005-04-16 1823 } while (pte++, addr += PAGE_SIZE, addr != end);
6606c3e0da5360 Zachary Amsden 2006-09-30 1824 arch_leave_lazy_mmu_mode();
67a982ee20d20e Miaohe Lin 2021-02-24 1825 pte_unmap_unlock(mapped_pte, ptl);
42e4089c789072 Andi Kleen 2018-06-13 1826 return err;
^1da177e4c3f41 Linus Torvalds 2005-04-16 1827 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 1828
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-11-25 3:10 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-25 0:18 [android-common:android12-5.4 5/5] mm/memory.c:1807:22: warning: variable 'mapped_pte' set but not used kernel test robot
-- strict thread matches above, loose matches on Subject: below --
2025-11-25 2:26 kernel test robot
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.