All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/qxl: add NULL check for bo->resource
@ 2021-07-08 11:47 Christian König
  2021-07-08 12:10 ` Roberto Sassu
  0 siblings, 1 reply; 3+ messages in thread
From: Christian König @ 2021-07-08 11:47 UTC (permalink / raw)
  To: dri-devel, roberto.sassu

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>
---
 drivers/gpu/drm/qxl/qxl_ttm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/qxl/qxl_ttm.c b/drivers/gpu/drm/qxl/qxl_ttm.c
index 19fd39d9a00c..37a1b6a6ad6d 100644
--- a/drivers/gpu/drm/qxl/qxl_ttm.c
+++ b/drivers/gpu/drm/qxl/qxl_ttm.c
@@ -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);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* RE: [PATCH] drm/qxl: add NULL check for bo->resource
  2021-07-08 11:47 [PATCH] drm/qxl: add NULL check for bo->resource Christian König
@ 2021-07-08 12:10 ` Roberto Sassu
  2021-07-08 21:57   ` Daniel Vetter
  0 siblings, 1 reply; 3+ messages in thread
From: Roberto Sassu @ 2021-07-08 12:10 UTC (permalink / raw)
  To: Christian König, dri-devel

> From: Christian König [mailto:ckoenig.leichtzumerken@gmail.com]
> Sent: Thursday, July 8, 2021 1:47 PM
> 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>

Hi Christian

thanks, it worked.

Tested-by: Roberto Sassu <roberto.sassu@huawei.com>

Roberto

HUAWEI TECHNOLOGIES Duesseldorf GmbH, HRB 56063
Managing Director: Li Peng, Li Jian, Shi Yanli

> ---
>  drivers/gpu/drm/qxl/qxl_ttm.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/qxl/qxl_ttm.c b/drivers/gpu/drm/qxl/qxl_ttm.c
> index 19fd39d9a00c..37a1b6a6ad6d 100644
> --- a/drivers/gpu/drm/qxl/qxl_ttm.c
> +++ b/drivers/gpu/drm/qxl/qxl_ttm.c
> @@ -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);
> --
> 2.25.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/qxl: add NULL check for bo->resource
  2021-07-08 12:10 ` Roberto Sassu
@ 2021-07-08 21:57   ` Daniel Vetter
  0 siblings, 0 replies; 3+ messages in thread
From: Daniel Vetter @ 2021-07-08 21:57 UTC (permalink / raw)
  To: Roberto Sassu; +Cc: Christian König, dri-devel

On Thu, Jul 08, 2021 at 12:10:25PM +0000, Roberto Sassu wrote:
> > From: Christian König [mailto:ckoenig.leichtzumerken@gmail.com]
> > Sent: Thursday, July 8, 2021 1:47 PM
> > 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>
> 
> Hi Christian
> 
> thanks, it worked.
> 
> Tested-by: Roberto Sassu <roberto.sassu@huawei.com>

Doesn't this need a

Fixes: bfa3357ef9ab ("drm/ttm: allocate resource object instead of embedding it v2")

With that:

Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>

> 
> Roberto
> 
> HUAWEI TECHNOLOGIES Duesseldorf GmbH, HRB 56063
> Managing Director: Li Peng, Li Jian, Shi Yanli
> 
> > ---
> >  drivers/gpu/drm/qxl/qxl_ttm.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/gpu/drm/qxl/qxl_ttm.c b/drivers/gpu/drm/qxl/qxl_ttm.c
> > index 19fd39d9a00c..37a1b6a6ad6d 100644
> > --- a/drivers/gpu/drm/qxl/qxl_ttm.c
> > +++ b/drivers/gpu/drm/qxl/qxl_ttm.c
> > @@ -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);
> > --
> > 2.25.1
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-07-08 21:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-08 11:47 [PATCH] drm/qxl: add NULL check for bo->resource Christian König
2021-07-08 12:10 ` Roberto Sassu
2021-07-08 21:57   ` Daniel Vetter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.