From: Ben Skeggs Date: Tue, 17 Sep 2013 04:21:15 +0000 (+1000) Subject: drm/ttm: fix the tt_populated check in ttm_tt_destroy() X-Git-Tag: v3.12-rc2~17^2~2 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=182b17c8dc4e83aab000ce86587b6810e515da87;p=pandora-kernel.git drm/ttm: fix the tt_populated check in ttm_tt_destroy() After a vmalloc failure in ttm_dma_tt_alloc_page_directory(), ttm_dma_tt_init() will call ttm_tt_destroy() to cleanup, and end up inside the driver's unpopulate() hook when populate() has never yet been called. On nouveau, the first issue to be hit because of this is that dma_address[] may be a NULL pointer. After working around this, ttm_pool_unpopulate() may potentially hit the same issue with the pages[] array. It seems to make more sense to avoid calling unpopulate on already unpopulated TTMs than to add checks to all the implementations. Signed-off-by: Ben Skeggs Reviewed-by: Thomas Hellstrom Cc: stable@vger.kernel.org Cc: Jerome Glisse Signed-off-by: Dave Airlie --- Reading git-diff-tree failed