mm/damon: minor cleanup for damon_pa_young

if need_lock is true but folio_trylock fails, we should return false
instead of NULL to match the return value type exactly. No functional
change intended.

Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
Reviewed-by: SeongJae Park <sj@kernel.org>
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
This commit is contained in:
Miaohe Lin 2022-03-16 16:15:28 +08:00 committed by Matthew Wilcox (Oracle)
parent 72e7258874
commit 2a3c4bce3e
1 changed files with 1 additions and 1 deletions

View File

@ -152,7 +152,7 @@ static bool damon_pa_young(unsigned long paddr, unsigned long *page_sz)
need_lock = !folio_test_anon(folio) || folio_test_ksm(folio); need_lock = !folio_test_anon(folio) || folio_test_ksm(folio);
if (need_lock && !folio_trylock(folio)) { if (need_lock && !folio_trylock(folio)) {
folio_put(folio); folio_put(folio);
return NULL; return false;
} }
rmap_walk(folio, &rwc); rmap_walk(folio, &rwc);