浏览代码

ttm: on move memory failure don't leave a node dangling

if we have a move notify callback, when moving fails, we call move notify
the opposite way around, however this ends up with *mem containing the mm_node
from the bo, which means we double free it. This is a follow on to the previous
fix.

Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Dave Airlie 13 年之前
父节点
当前提交
014b34409f
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      drivers/gpu/drm/ttm/ttm_bo.c

+ 1 - 0
drivers/gpu/drm/ttm/ttm_bo.c

@@ -434,6 +434,7 @@ static int ttm_bo_handle_move_mem(struct ttm_buffer_object *bo,
 			bo->mem = tmp_mem;
 			bo->mem = tmp_mem;
 			bdev->driver->move_notify(bo, mem);
 			bdev->driver->move_notify(bo, mem);
 			bo->mem = *mem;
 			bo->mem = *mem;
+			*mem = tmp_mem;
 		}
 		}
 
 
 		goto out_err;
 		goto out_err;