diff --git a/drivers/gpu/drm/ttm/ttm_tt.c b/drivers/gpu/drm/ttm/ttm_tt.c index a7bab87..d940c82 100644 --- a/drivers/gpu/drm/ttm/ttm_tt.c +++ b/drivers/gpu/drm/ttm/ttm_tt.c @@ -547,12 +547,17 @@ int ttm_tt_swapout(struct ttm_tt *ttm, struct file *persistant_swap_storage) } else swap_storage = persistant_swap_storage; + BUG_ON(swap_storage == NULL); + BUG_ON(swap_storage->f_path.dentry == NULL); + BUG_ON(swap_storage->f_path.dentry->d_inode == NULL); + swap_space = swap_storage->f_path.dentry->d_inode->i_mapping; for (i = 0; i < ttm->num_pages; ++i) { from_page = ttm->pages[i]; if (unlikely(from_page == NULL)) continue; + BUG_ON(swap_space == NULL); to_page = read_mapping_page(swap_space, i, NULL); if (unlikely(IS_ERR(to_page))) { ret = PTR_ERR(to_page);