drm/qxl: add NULL check for bo->resource
Subsystems (3)
PATCH 1/1 drm/qxl: add NULL check for bo->resource
When allocations fails that can be NULL now.
Signed-off-by Christian König <[email protected]>
Reported-by Daniel Bristot de Oliveira <[email protected]>
--- drivers/gpu/drm/qxl/qxl_ttm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/qxl/qxl_ttm.c +1 -1
@@ -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);
Signature · 1 line
2.25.1
Quoted 7 lines
From: Christian König [mailto:[email protected]]
Sent: Thursday, July 8, 2021 1:47 PM
When allocations fails that can be NULL now.Signed-off-by Christian König <[email protected]>Reported-by Daniel Bristot de Oliveira <[email protected]>
Hi Christian
thanks, it worked.
Tested-by Roberto Sassu <[email protected]>
Roberto
HUAWEI TECHNOLOGIES Duesseldorf GmbH, HRB 56063
Managing Director: Li Peng, Li Jian, Shi Yanli
Quoted 20 lines
--- drivers/gpu/drm/qxl/qxl_ttm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/qxl/qxl_ttm.c +1
-1@@ -127,7 +127,7 @@ static void qxl_bo_move_notify(structttm_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);
--
2.25.1
Daniel Vetter
Acked-byQuoted 8 lines · Roberto Sassu
Quoted 7 lines
From: Christian König [mailto:[email protected]]
Sent: Thursday, July 8, 2021 1:47 PM
When allocations fails that can be NULL now.Signed-off-by Christian König <[email protected]>Reported-by Daniel Bristot de Oliveira <[email protected]>
Quoted 5 lines
Hi Christian
thanks, it worked.
Tested-by Roberto Sassu <[email protected]>
Doesn't this need a
Fixes bfa3357ef9ab ("drm/ttm: allocate resource object instead of embedding it v2")
With that:
Acked-by Daniel Vetter <[email protected]>
Quoted 27 lines
Roberto
HUAWEI TECHNOLOGIES Duesseldorf GmbH, HRB 56063
Managing Director: Li Peng, Li Jian, Shi YanliQuoted 20 lines
--- drivers/gpu/drm/qxl/qxl_ttm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/qxl/qxl_ttm.c +1
-1@@ -127,7 +127,7 @@ static void qxl_bo_move_notify(structttm_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);
--
2.25.1
Signature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch