drm/qxl: add NULL check for bo->resource
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: bfa3357ef9
("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
This commit is contained in:
parent
f18f58012e
commit
3efe180d51
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue