Skip to content
Permalink
Browse files
staging: android: Remove BUG_ON from ion_page_pool.c
BUG_ON() is removed at ion_page_pool.c

Fixes the following issue:
Avoid crashing the kernel - try using WARN_ON & recovery code ratherthan BUG() or BUG_ON().

Signed-off-by: Tomer Samara <tomersamara98@gmail.com>
  • Loading branch information
TomerSamara98 authored and intel-lab-lkp committed Aug 21, 2020
1 parent bc752d2 commit 855a2d27af07d8bf02bc2f5cd75a7f87d1e94686
Showing 1 changed file with 1 addition and 5 deletions.
@@ -46,11 +46,9 @@ static struct page *ion_page_pool_remove(struct ion_page_pool *pool, bool high)
struct page *page;

if (high) {
BUG_ON(!pool->high_count);
page = list_first_entry(&pool->high_items, struct page, lru);
pool->high_count--;
} else {
BUG_ON(!pool->low_count);
page = list_first_entry(&pool->low_items, struct page, lru);
pool->low_count--;
}
@@ -65,8 +63,6 @@ struct page *ion_page_pool_alloc(struct ion_page_pool *pool)
{
struct page *page = NULL;

BUG_ON(!pool);

mutex_lock(&pool->mutex);
if (pool->high_count)
page = ion_page_pool_remove(pool, true);
@@ -82,7 +78,7 @@ struct page *ion_page_pool_alloc(struct ion_page_pool *pool)

void ion_page_pool_free(struct ion_page_pool *pool, struct page *page)
{
BUG_ON(pool->order != compound_order(page));
WARN_ON(pool->order != compound_order(page))

ion_page_pool_add(pool, page);
}

0 comments on commit 855a2d2

Please sign in to comment.