]> www.infradead.org Git - users/jedix/linux-maple.git/commit
mm/migrate_device: do not access pgmap for non zone device pages
authorBalbir Singh <balbirs@nvidia.com>
Wed, 19 Feb 2025 23:13:37 +0000 (10:13 +1100)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 28 Feb 2025 01:00:13 +0000 (17:00 -0800)
commit75c623600ea23dc8af5aa3a06f3afc5c562a8abb
treecf7b188c70d77e491a1bedf01dac7d08ea0a565c
parent1a0a1b5c40e897d5453e6f9053df60279673cd45
mm/migrate_device: do not access pgmap for non zone device pages

page_pgmap() is referenced before checking if the page is a zone device
page and this triggers the warning in page_pgmap().  Refactor the code to
use the helper function after relevant checks.

Link: https://lkml.kernel.org/r/20250219231337.364133-1-balbirs@nvidia.com
Signed-off-by: Balbir Singh <balbirs@nvidia.com>
Reviewed-by: Alistair Popple <apopple@nvidia.com>
Acked-by: David Hildenbrand <david@redhat.com>
Cc: Jason Gunthorpe <jgg@ziepe.ca>
Cc: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/migrate_device.c