Commit 3efe180d authored by Christian König's avatar Christian König
Browse files

drm/qxl: add NULL check for bo->resource



When allocations fails that can be NULL now.

Signed-off-by: default avatarChristian König <christian.koenig@amd.com>
Reported-by: default avatarDaniel Bristot de Oliveira <bristot@kernel.org>
Tested-by: default avatarDaniel Bristot de Oliveira <bristot@kernel.org>
Tested-by: default avatarRoberto Sassu <roberto.sassu@huawei.com>
Fixes: bfa3357e ("drm/ttm: allocate resource object instead of embedding it v2")
Acked-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20210708114710.8186-1-christian.koenig@amd.com
parent f18f5801
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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);