drm/i915/selftests: fix a couple IS_ERR() vs NULL tests
authorjsg <jsg@openbsd.org>
Fri, 22 Jul 2022 06:04:44 +0000 (06:04 +0000)
committerjsg <jsg@openbsd.org>
Fri, 22 Jul 2022 06:04:44 +0000 (06:04 +0000)
From Dan Carpenter
40c12fc520234b0145bb776f38642507180dfad8 in linux 5.15.y/5.15.56
896dcabd1f8f613c533d948df17408c41f8929f5 in mainline linux

sys/dev/pci/drm/i915/gt/selftest_lrc.c

index b0977a3..bc2950f 100644 (file)
@@ -153,8 +153,8 @@ static int live_lrc_layout(void *arg)
                        continue;
 
                hw = shmem_pin_map(engine->default_state);
-               if (IS_ERR(hw)) {
-                       err = PTR_ERR(hw);
+               if (!hw) {
+                       err = -ENOMEM;
                        break;
                }
                hw += LRC_STATE_OFFSET / sizeof(*hw);
@@ -329,8 +329,8 @@ static int live_lrc_fixed(void *arg)
                        continue;
 
                hw = shmem_pin_map(engine->default_state);
-               if (IS_ERR(hw)) {
-                       err = PTR_ERR(hw);
+               if (!hw) {
+                       err = -ENOMEM;
                        break;
                }
                hw += LRC_STATE_OFFSET / sizeof(*hw);