]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/qxl: add NULL check for bo->resource
authorChristian König <christian.koenig@amd.com>
Tue, 6 Jul 2021 06:51:25 +0000 (08:51 +0200)
committerChristian König <christian.koenig@amd.com>
Fri, 9 Jul 2021 10:43:13 +0000 (12:43 +0200)
When allocations fails that can be NULL now.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reported-by: Daniel Bristot de Oliveira <bristot@kernel.org>
Tested-by: Daniel Bristot de Oliveira <bristot@kernel.org>
Tested-by: Roberto Sassu <roberto.sassu@huawei.com>
Fixes: bfa3357ef9ab ("drm/ttm: allocate resource object instead of embedding it v2")
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20210708114710.8186-1-christian.koenig@amd.com
drivers/gpu/drm/qxl/qxl_ttm.c

index 19fd39d9a00cb40fabf6c15cb138557aa0524496..37a1b6a6ad6dce536e3d7527690c778b1b5173af 100644 (file)
@@ -127,7 +127,7 @@ static void qxl_bo_move_notify(struct ttm_buffer_object *bo,
        struct qxl_bo *qbo;
        struct qxl_device *qdev;
 
-       if (!qxl_ttm_bo_is_qxl_bo(bo))
+       if (!qxl_ttm_bo_is_qxl_bo(bo) || !bo->resource)
                return;
        qbo = to_qxl_bo(bo);
        qdev = to_qxl(qbo->tbo.base.dev);