drm/i915/selftests: fix a couple IS_ERR() vs NULL tests

The shmem_pin_map() function doesn't return error pointers, it returns
NULL.

Fixes: be1cb55a07 ("drm/i915/gt: Keep a no-frills swappable copy of the default context state")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220708094104.GL2316@kadam
This commit is contained in:
Dan Carpenter 2022-07-08 12:41:04 +03:00 коммит произвёл Matthew Auld
Родитель 7835303982
Коммит d50f5a109c
1 изменённых файлов: 4 добавлений и 4 удалений

Просмотреть файл

@ -176,8 +176,8 @@ static int live_lrc_layout(void *arg)
continue; continue;
hw = shmem_pin_map(engine->default_state); hw = shmem_pin_map(engine->default_state);
if (IS_ERR(hw)) { if (!hw) {
err = PTR_ERR(hw); err = -ENOMEM;
break; break;
} }
hw += LRC_STATE_OFFSET / sizeof(*hw); hw += LRC_STATE_OFFSET / sizeof(*hw);
@ -365,8 +365,8 @@ static int live_lrc_fixed(void *arg)
continue; continue;
hw = shmem_pin_map(engine->default_state); hw = shmem_pin_map(engine->default_state);
if (IS_ERR(hw)) { if (!hw) {
err = PTR_ERR(hw); err = -ENOMEM;
break; break;
} }
hw += LRC_STATE_OFFSET / sizeof(*hw); hw += LRC_STATE_OFFSET / sizeof(*hw);