[PATCH v2 2/2] drm/xe/client: drop bogus bo NULL check

Nirmoy Das nirmoy.das at linux.intel.com
Mon Mar 18 09:45:27 UTC 2024


On 3/18/2024 10:34 AM, Matthew Auld wrote:
> If we fished it out the list then it can't be null; the list entry is
> embedded in the bo.
>
> Signed-off-by: Matthew Auld <matthew.auld at intel.com>
> Cc: Nirmoy Das <nirmoy.das at intel.com>
Reviewed-by: Nirmoy Das <nirmoy.das at intel.com>
> ---
>   drivers/gpu/drm/xe/xe_drm_client.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/xe/xe_drm_client.c b/drivers/gpu/drm/xe/xe_drm_client.c
> index 59b01d838229..08f0b7c95901 100644
> --- a/drivers/gpu/drm/xe/xe_drm_client.c
> +++ b/drivers/gpu/drm/xe/xe_drm_client.c
> @@ -155,7 +155,7 @@ static void show_meminfo(struct drm_printer *p, struct drm_file *file)
>   	/* Internal objects. */
>   	spin_lock(&client->bos_lock);
>   	list_for_each_entry(bo, &client->bos_list, client_link) {
> -		if (!bo || !kref_get_unless_zero(&bo->ttm.base.refcount))
> +		if (!kref_get_unless_zero(&bo->ttm.base.refcount))
>   			continue;
>   		bo_meminfo(bo, stats);
>   		xe_bo_put(bo);


More information about the Intel-xe mailing list