From d14288049e3a886dc332237e7e3c204ba152d6bb Mon Sep 17 00:00:00 2001 From: Seth Jennings Date: Wed, 19 Jun 2013 10:07:00 +1000 Subject: [PATCH] zswap: init under_reclaim Bob Liu reported a memory leak in zswap. This was due to the under_reclaim field in the zbud header not being initialized to 0, which resulted in zbud_free() not freeing the page under the false assumption that the page was undergoing zbud reclaim. This patch properly initializes the under_reclaim field. Signed-off-by: Seth Jennings Reported-by: Bob Liu Signed-off-by: Andrew Morton --- mm/zbud.c | 1 + 1 file changed, 1 insertion(+) diff --git a/mm/zbud.c b/mm/zbud.c index d63ae6ec17db..9bb4710e3589 100644 --- a/mm/zbud.c +++ b/mm/zbud.c @@ -138,6 +138,7 @@ static struct zbud_header *init_zbud_page(struct page *page) zhdr->last_chunks = 0; INIT_LIST_HEAD(&zhdr->buddy); INIT_LIST_HEAD(&zhdr->lru); + zhdr->under_reclaim = 0; return zhdr; } -- 2.39.5