[bug report] drm/ttm: switch to per device LRU lock

Dan Carpenter dan.carpenter at oracle.com
Fri Mar 26 08:57:42 UTC 2021


Hello Christian König,

This is a semi-automatic email about new static checker warnings.

The patch a1f091f8ef2b: "drm/ttm: switch to per device LRU lock" from
Oct 6, 2020, leads to the following Smatch complaint:

    drivers/gpu/drm/ttm/ttm_bo.c:665 ttm_mem_evict_first()
    error: we previously assumed 'bo' could be null (see line 662)

drivers/gpu/drm/ttm/ttm_bo.c
   661	
   662		if (!bo) {
                     ^^
"bo" is NULL

   663			if (busy_bo && !ttm_bo_get_unless_zero(busy_bo))
   664				busy_bo = NULL;
   665			spin_unlock(&bo->bdev->lru_lock);
                                     ^^^^^^^^^^^^^^^^^^
Dereference

   666			ret = ttm_mem_evict_wait_busy(busy_bo, ctx, ticket);
   667			if (busy_bo)

regards,
dan carpenter


More information about the dri-devel mailing list