]> www.infradead.org Git - users/jedix/linux-maple.git/commit
mm/gup.c: Fix return value for __gup_longterm_locked()
authorShigeru Yoshida <syoshida@redhat.com>
Sun, 21 Aug 2022 18:35:47 +0000 (03:35 +0900)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 26 Aug 2022 05:02:53 +0000 (22:02 -0700)
commit11147539df44e6165b59d4b0e9a13b91823428e2
treefaafdb39ee88e52d695fab8bc5640e98a40a670d
parentbc2def8d3ccad28640e432a85ca67f3cb44a5ad5
mm/gup.c: Fix return value for __gup_longterm_locked()

__get_user_pages_locked() may return the number of pages less than
nr_pages.  So __gup_longterm_locked() have to return the number of pages
__get_user_pages_locked() returns if it succeeded, not nr_pages requested.

Link: https://lkml.kernel.org/r/20220821183547.950370-1-syoshida@redhat.com
Fixes: 61c63c2076d9 (mm/gup.c: simplify and fix check_and_migrate_movable_pages() return codes)
Signed-off-by: Shigeru Yoshida <syoshida@redhat.com>
Reviewed-by: John Hubbard <jhubbard@nvidia.com>
Reported-by: syzbot+616ff0452fec30f4dcfd@syzkaller.appspotmail.com
Reviewed-by: Alistair Popple <apopple@nvidia.com>
Cc: David Hildenbrand <david@redhat.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/gup.c