Resources about to be destructed are not tied to BOs any more.
Unified · Split
| @@ -156,8 +156,12 @@ int ttm_device_swapout(struct ttm_device *bdev, struct ttm_operation_ctx *ctx, · 155 unmodified lines | ||
| 156 | 156 | |
| 157 | 157 | ttm_resource_manager_for_each_res(man, &cursor, res) { |
| 158 | 158 | struct ttm_buffer_object *bo = res->bo; |
| 159 | − uint32_t num_pages = PFN_UP(bo->base.size); | |
| 159 | + uint32_t num_pages; | |
| 160 | 160 | |
| 161 | + if (!bo) | |
| 162 | + continue; | |
| 163 | + | |
| 164 | + num_pages = PFN_UP(bo->base.size); | |
| 161 | 165 | ret = ttm_bo_swapout(bo, ctx, gfp_flags); |
| 162 | 166 | /* ttm_bo_swapout has dropped the lru_lock */ |
| 163 | 167 | if (!ret) |