Merge drm/drm-fixes into drm-misc-fixes
[sfrench/cifs-2.6.git] / drivers / gpu / drm / ttm / ttm_device.c
index c7a1862f322a1cfadb039d58f52d2fcd30e07dd1..ae2f19dc9f81696894f010a732d5e78fad950276 100644 (file)
@@ -158,7 +158,7 @@ int ttm_device_swapout(struct ttm_device *bdev, struct ttm_operation_ctx *ctx,
                        struct ttm_buffer_object *bo = res->bo;
                        uint32_t num_pages;
 
-                       if (!bo)
+                       if (!bo || bo->resource != res)
                                continue;
 
                        num_pages = PFN_UP(bo->base.size);