[PATCH] drm/ttm: fix access to uninitialized variable.

Das, Nirmoy nirmoy.das at amd.com
Mon Jun 7 19:10:43 UTC 2021


Reviewed-by:  Nirmoy Das <nirmoy.das at 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 at 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);


More information about the dri-devel mailing list