[PATCH][stable-4.1/3.18] mm/swap.c: Fix a copy&paste error during backport

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When backport 8f182270dfec432e ("mm/swap.c: flush lru pvecs on compound
page arrival") to 4.1/3.18 stable branches, there is a copy&paste error
which will cause memory leak and then an OOM.

Signed-off-by: Huacai Chen <chenhc@xxxxxxxxxx>
---
 mm/swap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/swap.c b/mm/swap.c
index b523f0a..ab3b9c2 100644
--- a/mm/swap.c
+++ b/mm/swap.c
@@ -631,7 +631,7 @@ static void __lru_cache_add(struct page *page)
 	struct pagevec *pvec = &get_cpu_var(lru_add_pvec);
 
 	page_cache_get(page);
-	if (!pagevec_space(pvec) || PageCompound(page))
+	if (!pagevec_add(pvec, page) || PageCompound(page))
 		__pagevec_lru_add(pvec);
 	put_cpu_var(lru_add_pvec);
 }
-- 
2.7.0



--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]