As per documentation and other places calling putback_lru_pages(),
putback_lru_pages() is called on error only. Make the CMA code behave
consistently.
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Acked-by: Michal Nazarewicz <mina86@mina86.com>
Cc: Marek Szyprowski <m.szyprowski@samsung.com>
Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
0, false, MIGRATE_SYNC,
MR_CMA);
}
-
- putback_movable_pages(&cc->migratepages);
+ if (ret < 0)
+ putback_movable_pages(&cc->migratepages);
return ret > 0 ? 0 : ret;
}