Skip to content

Commit

Permalink
drm/qxl: add NULL check for bo->resource
Browse files Browse the repository at this point in the history
When allocations fails that can be NULL now.

Signed-off-by: Christian König <[email protected]>
Reported-by: Daniel Bristot de Oliveira <[email protected]>
Tested-by: Daniel Bristot de Oliveira <[email protected]>
Tested-by: Roberto Sassu <[email protected]>
Fixes: bfa3357 ("drm/ttm: allocate resource object instead of embedding it v2")
Acked-by: Daniel Vetter <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
  • Loading branch information
ChristianKoenigAMD committed Jul 9, 2021
1 parent f18f580 commit 3efe180
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/gpu/drm/qxl/qxl_ttm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 3efe180

Please sign in to comment.