diff options
author | Miaohe Lin <linmiaohe@huawei.com> | 2021-09-02 23:53:42 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2021-09-03 18:58:11 +0200 |
commit | 6401c4eb57f947a49eb144b5b0787cde3318e82e (patch) | |
tree | 29f1b1a07e161b22f56ca111541c9abb1d9cae55 /mm/rodata_test.c | |
parent | mm: gup: remove useless BUG_ON in __get_user_pages() (diff) | |
download | linux-6401c4eb57f947a49eb144b5b0787cde3318e82e.tar.xz linux-6401c4eb57f947a49eb144b5b0787cde3318e82e.zip |
mm: gup: fix potential pgmap refcnt leak in __gup_device_huge()
When failed to try_grab_page, put_dev_pagemap() is missed. So pgmap
refcnt will leak in this case. Also we remove the check for pgmap against
NULL as it's also checked inside the put_dev_pagemap().
[akpm@linux-foundation.org: simplify, cleanup]
[akpm@linux-foundation.org: fix return value]
Link: https://lkml.kernel.org/r/20210807093620.21347-5-linmiaohe@huawei.com
Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
Fixes: 3faa52c03f44 ("mm/gup: track FOLL_PIN pages")
Reviewed-by: John Hubbard <jhubbard@nvidia.com>
Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
Cc: Jan Kara <jack@suse.cz>
Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/rodata_test.c')
0 files changed, 0 insertions, 0 deletions