Subject: linux-next: manual merge of the mm-hotfixes tree with Linus' tree

From: Stephen Rothwell <[email-masked]>
Date: Mon, 21 Oct 2024 08:55:22 +1100

Hi all,

Today's linux-next merge of the mm-hotfixes tree got a conflict in:

  mm/memory.c

between commit:

  b1b46751671b ("mm: fix follow_pfnmap API lockdep assert")

from Linus' tree and commit:

  dc68a7b3e7b4 ("mm: fix null pointer dereference in pfnmap_lockdep_assert")

from the mm-hotfixes tree.

I fixed it up (though the choice was arbitrary - see below) and can
carry the fix as necessary. This is now fixed as far as linux-next is
concerned, but any non trivial conflicts should be mentioned to your
upstream maintainer when your tree is submitted for merging.  You may
also want to consider cooperating with the maintainer of the
conflicting tree to minimise any particularly complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc mm/memory.c
index 3ccee51adfbb,3277454d3585..000000000000
--- a/mm/memory.c
+++ b/mm/memory.c
@@@ -6350,11 -6361,13 +6361,11 @@@ static inline void pfnmap_args_setup(st
  static inline void pfnmap_lockdep_assert(struct vm_area_struct *vma)
  {
  #ifdef CONFIG_LOCKDEP
 -	struct address_space *mapping = NULL;
 -
 -	if (vma->vm_file)
 -		mapping = vma->vm_file->f_mapping;
 +	struct file *file = vma->vm_file;
 +	struct address_space *mapping = file ? file->f_mapping : NULL;
  
  	if (mapping)
- 		lockdep_assert(lockdep_is_held(&vma->vm_file->f_mapping->i_mmap_rwsem) ||
+ 		lockdep_assert(lockdep_is_held(&mapping->i_mmap_rwsem) ||
  			       lockdep_is_held(&vma->vm_mm->mmap_lock));
  	else
  		lockdep_assert(lockdep_is_held(&vma->vm_mm->mmap_lock));