diff options
| -rw-r--r-- | drivers/gpu/drm/ttm/ttm_bo_util.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/gpu/drm/ttm/ttm_bo_util.c b/drivers/gpu/drm/ttm/ttm_bo_util.c index d73d6e3e17b2..44420fca7dfa 100644 --- a/drivers/gpu/drm/ttm/ttm_bo_util.c +++ b/drivers/gpu/drm/ttm/ttm_bo_util.c | |||
| @@ -344,8 +344,12 @@ int ttm_bo_move_memcpy(struct ttm_buffer_object *bo, | |||
| 344 | 344 | ||
| 345 | if (ttm->state == tt_unpopulated) { | 345 | if (ttm->state == tt_unpopulated) { |
| 346 | ret = ttm->bdev->driver->ttm_tt_populate(ttm); | 346 | ret = ttm->bdev->driver->ttm_tt_populate(ttm); |
| 347 | if (ret) | 347 | if (ret) { |
| 348 | /* if we fail here don't nuke the mm node | ||
| 349 | * as the bo still owns it */ | ||
| 350 | old_copy.mm_node = NULL; | ||
| 348 | goto out1; | 351 | goto out1; |
| 352 | } | ||
| 349 | } | 353 | } |
| 350 | 354 | ||
| 351 | add = 0; | 355 | add = 0; |
| @@ -371,8 +375,11 @@ int ttm_bo_move_memcpy(struct ttm_buffer_object *bo, | |||
| 371 | prot); | 375 | prot); |
| 372 | } else | 376 | } else |
| 373 | ret = ttm_copy_io_page(new_iomap, old_iomap, page); | 377 | ret = ttm_copy_io_page(new_iomap, old_iomap, page); |
| 374 | if (ret) | 378 | if (ret) { |
| 379 | /* failing here, means keep old copy as-is */ | ||
| 380 | old_copy.mm_node = NULL; | ||
| 375 | goto out1; | 381 | goto out1; |
| 382 | } | ||
| 376 | } | 383 | } |
| 377 | mb(); | 384 | mb(); |
| 378 | out2: | 385 | out2: |
