Message ID | 20210816072147.3481782-8-chenhuang5@huawei.com |
---|---|
State | New |
Headers | show |
Series | mm: memcontrol: fix nullptr in __mod_lruvec_page_state() | expand |
diff --git a/mm/memcontrol.c b/mm/memcontrol.c index d45c2c97d9b8..73418413958c 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -6907,6 +6907,7 @@ static void uncharge_page(struct page *page, struct uncharge_gather *ug) uncharge_gather_clear(ug); } ug->memcg = page_memcg(page); + ug->dummy_page = page; /* pairs with css_put in uncharge_batch */ css_get(&ug->memcg->css); @@ -6920,7 +6921,6 @@ static void uncharge_page(struct page *page, struct uncharge_gather *ug) else ug->pgpgout++; - ug->dummy_page = page; page->memcg_data = 0; css_put(&ug->memcg->css); }