Skip to content

Commit

Permalink
mm/damon: minor cleanup for damon_pa_young
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
MiaoheLin authored and Matthew Wilcox (Oracle) committed Mar 21, 2022
1 parent 72e7258 commit 2a3c4bc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mm/damon/paddr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
if (need_lock && !folio_trylock(folio)) {
folio_put(folio);
return NULL;
return false;
}

rmap_walk(folio, &rwc);
Expand Down

0 comments on commit 2a3c4bc

Please sign in to comment.