All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/ttm: fix access to uninitialized variable.
@ 2021-06-07 17:11 Christian König
  2021-06-07 17:35 ` Thomas Hellström (Intel)
  2021-06-07 19:10 ` Das, Nirmoy
  0 siblings, 2 replies; 3+ messages in thread
From: Christian König @ 2021-06-07 17:11 UTC (permalink / raw)
  To: thomas_os, dri-devel

The resource is not allocated yet, so no chance that this will work.

Use the placement instead.

Signed-off-by: Christian König <christian.koenig@amd.com>
---
 drivers/gpu/drm/ttm/ttm_bo.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
index 7e7284da5630..0c74f4cb2a3b 100644
--- a/drivers/gpu/drm/ttm/ttm_bo.c
+++ b/drivers/gpu/drm/ttm/ttm_bo.c
@@ -736,7 +736,7 @@ static int ttm_bo_mem_force_space(struct ttm_buffer_object *bo,
 	struct ww_acquire_ctx *ticket;
 	int ret;
 
-	man = ttm_manager_type(bdev, (*mem)->mem_type);
+	man = ttm_manager_type(bdev, place->mem_type);
 	ticket = dma_resv_locking_ctx(bo->base.resv);
 	do {
 		ret = ttm_resource_alloc(bo, place, mem);
-- 
2.25.1


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

* Re: [PATCH] drm/ttm: fix access to uninitialized variable.
  2021-06-07 17:11 [PATCH] drm/ttm: fix access to uninitialized variable Christian König
@ 2021-06-07 17:35 ` Thomas Hellström (Intel)
  2021-06-07 19:10 ` Das, Nirmoy
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas Hellström (Intel) @ 2021-06-07 17:35 UTC (permalink / raw)
  To: Christian König, dri-devel


On 6/7/21 7:11 PM, Christian König wrote:
> The resource is not allocated yet, so no chance that this will work.
>
> Use the placement instead.
>
> Signed-off-by: Christian König <christian.koenig@amd.com>

Reviewed-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>


> ---
>   drivers/gpu/drm/ttm/ttm_bo.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
> index 7e7284da5630..0c74f4cb2a3b 100644
> --- a/drivers/gpu/drm/ttm/ttm_bo.c
> +++ b/drivers/gpu/drm/ttm/ttm_bo.c
> @@ -736,7 +736,7 @@ static int ttm_bo_mem_force_space(struct ttm_buffer_object *bo,
>   	struct ww_acquire_ctx *ticket;
>   	int ret;
>   
> -	man = ttm_manager_type(bdev, (*mem)->mem_type);
> +	man = ttm_manager_type(bdev, place->mem_type);
>   	ticket = dma_resv_locking_ctx(bo->base.resv);
>   	do {
>   		ret = ttm_resource_alloc(bo, place, mem);

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

* Re: [PATCH] drm/ttm: fix access to uninitialized variable.
  2021-06-07 17:11 [PATCH] drm/ttm: fix access to uninitialized variable Christian König
  2021-06-07 17:35 ` Thomas Hellström (Intel)
@ 2021-06-07 19:10 ` Das, Nirmoy
  1 sibling, 0 replies; 3+ messages in thread
From: Das, Nirmoy @ 2021-06-07 19:10 UTC (permalink / raw)
  To: dri-devel

Reviewed-by:  Nirmoy Das <nirmoy.das@amd.com>

On 6/7/2021 7:11 PM, Christian König wrote:
> The resource is not allocated yet, so no chance that this will work.
>
> Use the placement instead.
>
> Signed-off-by: Christian König <christian.koenig@amd.com>
> ---
>   drivers/gpu/drm/ttm/ttm_bo.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
> index 7e7284da5630..0c74f4cb2a3b 100644
> --- a/drivers/gpu/drm/ttm/ttm_bo.c
> +++ b/drivers/gpu/drm/ttm/ttm_bo.c
> @@ -736,7 +736,7 @@ static int ttm_bo_mem_force_space(struct ttm_buffer_object *bo,
>   	struct ww_acquire_ctx *ticket;
>   	int ret;
>   
> -	man = ttm_manager_type(bdev, (*mem)->mem_type);
> +	man = ttm_manager_type(bdev, place->mem_type);
>   	ticket = dma_resv_locking_ctx(bo->base.resv);
>   	do {
>   		ret = ttm_resource_alloc(bo, place, mem);

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

end of thread, other threads:[~2021-06-07 19:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-07 17:11 [PATCH] drm/ttm: fix access to uninitialized variable Christian König
2021-06-07 17:35 ` Thomas Hellström (Intel)
2021-06-07 19:10 ` Das, Nirmoy

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.