mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-04 18:19:28 +09:00
drm/ttm: Handle in-memory region copies
commit 9a0599ddea upstream.
Fix the case where the ttm pointer may be NULL causing
a NULL pointer dereference.
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
Signed-off-by: Thomas Hellström <thellstrom@vmware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
4f94b6e4b4
commit
f692d2d8be
@@ -347,7 +347,9 @@ int ttm_bo_move_memcpy(struct ttm_buffer_object *bo,
|
||||
if (old_iomap == NULL && ttm == NULL)
|
||||
goto out2;
|
||||
|
||||
if (ttm->state == tt_unpopulated) {
|
||||
/* TTM might be null for moves within the same region.
|
||||
*/
|
||||
if (ttm && ttm->state == tt_unpopulated) {
|
||||
ret = ttm->bdev->driver->ttm_tt_populate(ttm);
|
||||
if (ret) {
|
||||
/* if we fail here don't nuke the mm node
|
||||
|
||||
Reference in New Issue
Block a user