Skip to content

Commit d50f5a1

Browse files
Dan Carpentermatt-auld
authored andcommitted
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: be1cb55 ("drm/i915/gt: Keep a no-frills swappable copy of the default context state") Signed-off-by: Dan Carpenter <[email protected]> Reviewed-by: Matthew Auld <[email protected]> Signed-off-by: Matthew Auld <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/20220708094104.GL2316@kadam
1 parent 7835303 commit d50f5a1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/gpu/drm/i915/gt/selftest_lrc.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,8 @@ static int live_lrc_layout(void *arg)
176176
continue;
177177

178178
hw = shmem_pin_map(engine->default_state);
179-
if (IS_ERR(hw)) {
180-
err = PTR_ERR(hw);
179+
if (!hw) {
180+
err = -ENOMEM;
181181
break;
182182
}
183183
hw += LRC_STATE_OFFSET / sizeof(*hw);
@@ -365,8 +365,8 @@ static int live_lrc_fixed(void *arg)
365365
continue;
366366

367367
hw = shmem_pin_map(engine->default_state);
368-
if (IS_ERR(hw)) {
369-
err = PTR_ERR(hw);
368+
if (!hw) {
369+
err = -ENOMEM;
370370
break;
371371
}
372372
hw += LRC_STATE_OFFSET / sizeof(*hw);

0 commit comments

Comments
 (0)