summaryrefslogtreecommitdiffstats
path: root/mm/util.c
diff options
context:
space:
mode:
authorzhong jiang <zhongjiang@huawei.com>2019-11-30 17:49:50 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2019-12-01 06:29:18 -0800
commitb96cc65515bb16f90a361c01da088ce09ad3cf92 (patch)
tree773593dd0ac9bc7c75bfe25e0f44f3cdab9470c4 /mm/util.c
parent9266a14033a81b3096feccd10542c20b3f47fe8e (diff)
downloadlinux-b96cc65515bb16f90a361c01da088ce09ad3cf92.tar.bz2
mm/gup.c: allow CMA migration to propagate errors back to caller
check_and_migrate_cma_pages() was recording the result of __get_user_pages_locked() in an unsigned "nr_pages" variable. Because __get_user_pages_locked() returns a signed value that can include negative errno values, this had the effect of hiding errors. Change check_and_migrate_cma_pages() implementation so that it uses a signed variable instead, and propagates the results back to the caller just as other gup internal functions do. This was discovered with the help of unsigned_lesser_than_zero.cocci. Link: http://lkml.kernel.org/r/1571671030-58029-1-git-send-email-zhongjiang@huawei.com Signed-off-by: zhong jiang <zhongjiang@huawei.com> Suggested-by: John Hubbard <jhubbard@nvidia.com> Acked-by: Vlastimil Babka <vbabka@suse.cz> Reviewed-by: John Hubbard <jhubbard@nvidia.com> Reviewed-by: Ira Weiny <ira.weiny@intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/util.c')
0 files changed, 0 insertions, 0 deletions