Ver Fonte

ANDROID: dma-buf: heaps: fix dma-buf heap pool pages stat

this critical region should be protected by pool->mutex.

Bug: 207658347
Fixes: e7dac4c3231c ("ANDROID: dma-buf: heaps: Add a shrinker controlled page pool")
Signed-off-by: liuhailong <[email protected]>
Signed-off-by: xieliujie <[email protected]>
Change-Id: I6f129926c96176258a965964c24602fc647db61e
xieliujie há 3 anos atrás
pai
commit
3ed40fb65a
1 ficheiros alterados com 1 adições e 1 exclusões
  1. 1 1
      drivers/dma-buf/heaps/page_pool.c

+ 1 - 1
drivers/dma-buf/heaps/page_pool.c

@@ -44,9 +44,9 @@ static void dmabuf_page_pool_add(struct dmabuf_page_pool *pool, struct page *pag
 	mutex_lock(&pool->mutex);
 	list_add_tail(&page->lru, &pool->items[index]);
 	pool->count[index]++;
-	mutex_unlock(&pool->mutex);
 	mod_node_page_state(page_pgdat(page), NR_KERNEL_MISC_RECLAIMABLE,
 			    1 << pool->order);
+	mutex_unlock(&pool->mutex);
 }
 
 static struct page *dmabuf_page_pool_remove(struct dmabuf_page_pool *pool, int index)