drm/ttm: Fix possible division by 0 in ttm_dma_pool_shrink_scan().
authorTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Sun, 3 Aug 2014 10:59:35 +0000 (19:59 +0900)
committerDave Airlie <airlied@redhat.com>
Tue, 5 Aug 2014 00:51:36 +0000 (10:51 +1000)
commit11e504cc705e8ccb06ac93a276e11b5e8fee4d40
tree7e6feb5fd586ac760f67a319ce19d3c9e9e9883c
parent74cd62ea46f19c41ef20a85792414973ba629cde
drm/ttm: Fix possible division by 0 in ttm_dma_pool_shrink_scan().

list_empty(&_manager->pools) being false before taking _manager->lock
does not guarantee that _manager->npools != 0 after taking _manager->lock
because _manager->npools is updated under _manager->lock.

Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Cc: stable <stable@kernel.org> [3.3+]
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/ttm/ttm_page_alloc_dma.c