Skip to contentSkip to conversation

drm/i915/selftests: Fix an IS_ERR() vs NULL check

PATCH In review Dan Carpenter 4 participants 6 messages Mar 26, 2019

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/i915/selftests: Fix an IS_ERR() vs NULL check

The live_context() function returns error pointers. It never returns NULL.

Fixes 9c1477e83e62 ("drm/i915/selftests: Exercise adding requests to a full GGTT")
---
 drivers/gpu/drm/i915/selftests/i915_gem_evict.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/i915/selftests/i915_gem_evict.c +1 -1
index 9a9451846b33..89766688e420 100644
@@ -455,7 +455,7 @@ static int igt_evict_contexts(void *arg)
 			struct i915_gem_context *ctx;
 
 			ctx = live_context(i915, file);
-			if (!ctx)
+			if (IS_ERR(ctx))
 				break;
 
 			/* We will need some GGTT space for the rq's context */
Signature · 6 lines
2.17.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Dan Carpenter

The live_context() function returns error pointers. It never returns NULL.

Fixes 9c1477e83e62 ("drm/i915/selftests: Exercise adding requests to a full GGTT")

i915_request.c has another :)

-Mika

Quoted 19 lines
---
 drivers/gpu/drm/i915/selftests/i915_gem_evict.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/i915/selftests/i915_gem_evict.c +1 -1
index 9a9451846b33..89766688e420 100644
@@ -455,7 +455,7 @@ static int igt_evict_contexts(void *arg)
 			struct i915_gem_context *ctx;
 
 			ctx = live_context(i915, file);
-			if (!ctx)
+			if (IS_ERR(ctx))
 				break;
 
 			/* We will need some GGTT space for the rq's context */
Signature · 1 line
2.17.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#4 lore raw

✓ Fi.CI.BAT: success for drm/i915/selftests: Fix an IS_ERR() vs NULL check

In reply to Dan Carpenter
== Series Details ==

== Series Details ==

Series: drm/i915/selftests: Fix an IS_ERR() vs NULL check
URL : https://patchwork.freedesktop.org/series/58557/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_5815 -> Patchwork_12598
====================================================

Summary
-------

**SUCCESS**

No regressions found.

External URL: https://patchwork.freedesktop.org/api/1.0/series/58557/revisions/1/mbox/

Known issues
------------

Here are the changes found in Patchwork_12598 that come from known issues:

### IGT changes ###

#### Issues hit ####

* igt@i915_selftest@live_contexts:
- fi-skl-gvtdvm: PASS -> DMESG-FAIL [fdo#110235 ]

* igt@kms_frontbuffer_tracking@basic:
- fi-icl-u3: PASS -> FAIL [fdo#103167]

* igt@kms_pipe_crc_basic@nonblocking-crc-pipe-a:
- fi-byt-clapper: PASS -> FAIL [fdo#107362]

* igt@kms_pipe_crc_basic@read-crc-pipe-a-frame-sequence:
- fi-byt-clapper: PASS -> FAIL [fdo#103191] / [fdo#107362]

#### Possible fixes ####

* igt@i915_selftest@live_contexts:
- fi-bdw-gvtdvm: DMESG-FAIL [fdo#110235 ] -> PASS

* igt@i915_selftest@live_execlists:
- fi-apl-guc: INCOMPLETE [fdo#103927] / [fdo#109720] -> PASS

* igt@i915_selftest@live_uncore:
- fi-ivb-3770: DMESG-FAIL [fdo#110210] -> PASS

* igt@kms_pipe_crc_basic@hang-read-crc-pipe-a:
- fi-byt-clapper: FAIL [fdo#103191] / [fdo#107362] -> PASS

* igt@kms_pipe_crc_basic@read-crc-pipe-a:
- fi-byt-clapper: FAIL [fdo#107362] -> PASS

* igt@prime_vgem@basic-fence-flip:
- fi-ilk-650: FAIL [fdo#104008] -> PASS
- fi-gdg-551: FAIL [fdo#103182] -> PASS

[fdo#103167]: https://bugs.freedesktop.org/show_bug.cgi?id=103167
[fdo#103182]: https://bugs.freedesktop.org/show_bug.cgi?id=103182
[fdo#103191]: https://bugs.freedesktop.org/show_bug.cgi?id=103191
[fdo#103927]: https://bugs.freedesktop.org/show_bug.cgi?id=103927
[fdo#104008]: https://bugs.freedesktop.org/show_bug.cgi?id=104008
[fdo#107362]: https://bugs.freedesktop.org/show_bug.cgi?id=107362
[fdo#109720]: https://bugs.freedesktop.org/show_bug.cgi?id=109720
[fdo#110210]: https://bugs.freedesktop.org/show_bug.cgi?id=110210
[fdo#110235 ]: https://bugs.freedesktop.org/show_bug.cgi?id=110235

Participating hosts (44 -> 40)
------------------------------

Missing (4): fi-ilk-m540 fi-bsw-cyan fi-bdw-samus fi-hsw-4200u

Build changes
-------------

* Linux: CI_DRM_5815 -> Patchwork_12598

CI_DRM_5815: 472ba88b1a76be18fb4ca6d688d6c5cda08cec81 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_4904: b9cfd64009ca2536f7a997deabf34d88f2757511 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_12598: b83064aeff50e708c9d827df85747ecdbc889d7b @ git://anongit.freedesktop.org/gfx-ci/linux

== Linux commits ==

b83064aeff50 drm/i915/selftests: Fix an IS_ERR() vs NULL check

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_12598/
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#2 lore raw
In reply to Mika Kuoppala

Quoting Mika Kuoppala (2019-03-26 09:30:57)

Quoted 11 lines
Quoted 5 lines · Dan Carpenter

The live_context() function returns error pointers. It never returns NULL.

Fixes 9c1477e83e62 ("drm/i915/selftests: Exercise adding requests to a full GGTT")

i915_request.c has another :)

Having found it, you could have typed up the patch :-p

Thanks for the fix, pushed.
-Chris
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#3 lore raw
Quoted 6 lines · Chris Wilson

Quoting Mika Kuoppala (2019-03-26 09:30:57)

Quoted 5 lines
Quoted 3 lines · Dan Carpenter

The live_context() function returns error pointers. It never returns NULL.

Quoted 9 lines
Quoted 6 lines
Quoted 2 lines
Fixes 9c1477e83e62 ("drm/i915/selftests: Exercise adding requests to a full GGTT")

i915_request.c has another :)

Having found it, you could have typed up the patch :-p

Smatch didn't warn about that one because we didn't dereference it right away... I should make a check which complains about the condition instead of the dereference.

regards,
dan carpenter

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#5 lore raw

✗ Fi.CI.IGT: failure for drm/i915/selftests: Fix an IS_ERR() vs NULL check

In reply to Dan Carpenter
== Series Details ==

== Series Details ==

Series: drm/i915/selftests: Fix an IS_ERR() vs NULL check
URL : https://patchwork.freedesktop.org/series/58557/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_5815_full -> Patchwork_12598_full
====================================================

Summary
-------

**FAILURE**

Serious unknown changes coming with Patchwork_12598_full absolutely need to be verified manually.

If you think the reported changes have nothing to do with the changes introduced in Patchwork_12598_full, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.

Possible new issues
-------------------

Here are the unknown changes that may have been introduced in Patchwork_12598_full:

### IGT changes ###

#### Possible regressions ####

* igt@gem_ringfill@basic-default-interruptible:
- shard-iclb: NOTRUN -> INCOMPLETE

#### Suppressed ####

The following results come from untrusted machines, tests, or statuses. They do not affect the overall result.

* {igt@gem_exec_big@single}:
- shard-iclb: NOTRUN -> INCOMPLETE

Known issues
------------

Here are the changes found in Patchwork_12598_full that come from known issues:

### IGT changes ###

#### Issues hit ####

* igt@gem_create@create-clear:
- shard-snb: PASS -> INCOMPLETE [fdo#105411]

* igt@gem_exec_params@no-blt:
- shard-snb: NOTRUN -> SKIP [fdo#109271] +194

* igt@gem_wait@await-bsd:
- shard-kbl: PASS -> DMESG-WARN [fdo#103558] / [fdo#105602] +8

* igt@i915_pm_lpsp@non-edp:
- shard-iclb: NOTRUN -> SKIP [fdo#109301]

* igt@i915_pm_rpm@cursor:
- shard-skl: NOTRUN -> INCOMPLETE [fdo#107807]

* igt@kms_atomic_transition@5x-modeset-transitions-nonblocking:
- shard-snb: NOTRUN -> SKIP [fdo#109271] / [fdo#109278] +22

* igt@kms_busy@basic-flip-d:
- shard-glk: NOTRUN -> SKIP [fdo#109271] / [fdo#109278]
- shard-apl: NOTRUN -> SKIP [fdo#109271] / [fdo#109278] +2

* igt@kms_busy@extended-modeset-hang-newfb-render-a:
- shard-snb: NOTRUN -> DMESG-WARN [fdo#110222]

* igt@kms_busy@extended-modeset-hang-newfb-render-d:
- shard-skl: NOTRUN -> SKIP [fdo#109271] / [fdo#109278]

* igt@kms_busy@extended-pageflip-hang-newfb-render-a:
- shard-apl: NOTRUN -> DMESG-WARN [fdo#110222] +1

* igt@kms_busy@extended-pageflip-modeset-hang-oldfb-render-c:
- shard-kbl: PASS -> DMESG-WARN [fdo#110222]

* igt@kms_busy@extended-pageflip-modeset-hang-oldfb-render-d:
- shard-iclb: NOTRUN -> SKIP [fdo#109278] +1

* igt@kms_color@pipe-a-ctm-max:
- shard-iclb: NOTRUN -> FAIL [fdo#108147]

* igt@kms_color@pipe-a-gamma:
- shard-iclb: NOTRUN -> FAIL [fdo#104782]

* igt@kms_cursor_crc@cursor-256x256-random:
- shard-apl: PASS -> FAIL [fdo#103232]

* igt@kms_cursor_crc@cursor-64x21-onscreen:
- shard-glk: PASS -> FAIL [fdo#103232]

* igt@kms_cursor_crc@cursor-64x64-suspend:
- shard-glk: NOTRUN -> FAIL [fdo#103232]

* igt@kms_cursor_legacy@2x-long-cursor-vs-flip-atomic:
- shard-iclb: NOTRUN -> SKIP [fdo#109274]

* igt@kms_cursor_legacy@cursor-vs-flip-atomic-transitions:
- shard-iclb: PASS -> FAIL [fdo#103355] +1

* igt@kms_fbcon_fbt@fbc:
- shard-iclb: PASS -> DMESG-WARN [fdo#109593]

* igt@kms_flip@flip-vs-expired-vblank:
- shard-kbl: PASS -> FAIL [fdo#102887] / [fdo#105363]

* igt@kms_frontbuffer_tracking@fbc-1p-primscrn-pri-shrfb-draw-blt:
- shard-iclb: NOTRUN -> FAIL [fdo#103167]

* igt@kms_frontbuffer_tracking@fbc-1p-primscrn-pri-shrfb-draw-mmap-gtt:
- shard-iclb: PASS -> FAIL [fdo#103167] +1

* igt@kms_frontbuffer_tracking@fbcpsr-1p-offscren-pri-indfb-draw-pwrite:
- shard-iclb: PASS -> FAIL [fdo#109247] +10

* igt@kms_frontbuffer_tracking@fbcpsr-2p-primscrn-cur-indfb-move:
- shard-iclb: NOTRUN -> SKIP [fdo#109280] +6

* igt@kms_frontbuffer_tracking@fbcpsr-shrfb-scaledprimary:
- shard-apl: NOTRUN -> SKIP [fdo#109271] +37

* igt@kms_frontbuffer_tracking@psr-2p-primscrn-spr-indfb-draw-mmap-cpu:
- shard-glk: NOTRUN -> SKIP [fdo#109271] +22

* igt@kms_plane@plane-panning-bottom-right-suspend-pipe-b-planes:
- shard-snb: PASS -> FAIL [fdo#103375]

* igt@kms_plane_alpha_blend@pipe-b-alpha-transparant-fb:
- shard-apl: NOTRUN -> FAIL [fdo#108145]

* igt@kms_plane_scaling@pipe-c-scaler-with-pixel-format:
- shard-glk: PASS -> SKIP [fdo#109271] / [fdo#109278]

* igt@kms_psr@primary_page_flip:
- shard-iclb: PASS -> FAIL [fdo#107383] / [fdo#110215]

* igt@kms_setmode@basic:
- shard-snb: NOTRUN -> FAIL [fdo#99912]

* igt@kms_vblank@pipe-a-ts-continuation-suspend:
- shard-iclb: PASS -> FAIL [fdo#104894]

* igt@perf_pmu@rc6-runtime-pm:
- shard-apl: PASS -> FAIL [fdo#105010]

* igt@prime_busy@before-bsd2:
- shard-iclb: NOTRUN -> SKIP [fdo#109276] +4

* igt@prime_vgem@sync-bsd1:
- shard-skl: NOTRUN -> SKIP [fdo#109271] +3

* igt@runner@aborted:
- shard-iclb: NOTRUN -> FAIL [fdo#109593]

#### Possible fixes ####

* igt@gem_exec_schedule@wide-render:
- shard-iclb: FAIL [fdo#109633] -> PASS

* igt@gem_softpin@noreloc-s3:
- shard-apl: INCOMPLETE [fdo#103927] -> PASS

* igt@i915_pm_rpm@system-suspend-modeset:
- shard-skl: INCOMPLETE [fdo#104108] / [fdo#107807] -> PASS

* igt@i915_selftest@live_workarounds:
- shard-iclb: DMESG-FAIL [fdo#108954] -> PASS

* igt@kms_busy@extended-modeset-hang-newfb-render-c:
- shard-iclb: DMESG-WARN [fdo#110222] -> PASS

* igt@kms_color@pipe-b-ctm-0-5:
- shard-glk: INCOMPLETE [fdo#103359] / [k.org#198133] -> PASS

* igt@kms_cursor_legacy@cursor-vs-flip-varying-size:
- shard-iclb: FAIL [fdo#103355] -> PASS

* igt@kms_flip_tiling@flip-to-y-tiled:
- shard-iclb: FAIL [fdo#107931] -> PASS

* igt@kms_frontbuffer_tracking@fbc-1p-offscren-pri-shrfb-draw-pwrite:
- shard-iclb: FAIL [fdo#103167] -> PASS +4

* igt@kms_frontbuffer_tracking@psr-rgb565-draw-render:
- shard-iclb: FAIL [fdo#109247] -> PASS +12

* igt@kms_plane_alpha_blend@pipe-c-coverage-7efc:
- shard-skl: FAIL [fdo#107815] -> PASS

* igt@kms_plane_lowres@pipe-a-tiling-none:
- shard-snb: SKIP [fdo#109271] -> PASS +1

* igt@kms_psr2_su@frontbuffer:
- shard-iclb: SKIP [fdo#109642] -> PASS

* igt@kms_psr@cursor_render:
- shard-iclb: DMESG-WARN [fdo#110025] -> PASS

* igt@kms_psr@psr2_cursor_plane_onoff:
- shard-iclb: SKIP [fdo#109441] -> PASS +2

* igt@kms_psr@sprite_render:
- shard-iclb: FAIL [fdo#107383] / [fdo#110215] -> PASS +1

* igt@kms_rotation_crc@multiplane-rotation-cropping-bottom:
- shard-kbl: DMESG-FAIL [fdo#105763] -> PASS

* igt@kms_vblank@pipe-c-ts-continuation-modeset:
- shard-apl: FAIL [fdo#104894] -> PASS

* igt@tools_test@tools_test:
- shard-glk: SKIP [fdo#109271] -> PASS

#### Warnings ####

* igt@kms_cursor_crc@cursor-64x64-suspend:
- shard-skl: INCOMPLETE [fdo#104108] -> FAIL [fdo#103191] / [fdo#103232]

* igt@kms_rotation_crc@multiplane-rotation:
- shard-kbl: DMESG-FAIL [fdo#105763] -> INCOMPLETE [fdo#103665]

* igt@perf_pmu@rc6-runtime-pm:
- shard-kbl: FAIL [fdo#105010] -> DMESG-WARN [fdo#103558] / [fdo#105602]

{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).

[fdo#102887]: https://bugs.freedesktop.org/show_bug.cgi?id=102887
[fdo#103167]: https://bugs.freedesktop.org/show_bug.cgi?id=103167
[fdo#103191]: https://bugs.freedesktop.org/show_bug.cgi?id=103191
[fdo#103232]: https://bugs.freedesktop.org/show_bug.cgi?id=103232
[fdo#103355]: https://bugs.freedesktop.org/show_bug.cgi?id=103355
[fdo#103359]: https://bugs.freedesktop.org/show_bug.cgi?id=103359
[fdo#103375]: https://bugs.freedesktop.org/show_bug.cgi?id=103375
[fdo#103558]: https://bugs.freedesktop.org/show_bug.cgi?id=103558
[fdo#103665]: https://bugs.freedesktop.org/show_bug.cgi?id=103665
[fdo#103927]: https://bugs.freedesktop.org/show_bug.cgi?id=103927
[fdo#104108]: https://bugs.freedesktop.org/show_bug.cgi?id=104108
[fdo#104782]: https://bugs.freedesktop.org/show_bug.cgi?id=104782
[fdo#104894]: https://bugs.freedesktop.org/show_bug.cgi?id=104894
[fdo#105010]: https://bugs.freedesktop.org/show_bug.cgi?id=105010
[fdo#105363]: https://bugs.freedesktop.org/show_bug.cgi?id=105363
[fdo#105411]: https://bugs.freedesktop.org/show_bug.cgi?id=105411
[fdo#105602]: https://bugs.freedesktop.org/show_bug.cgi?id=105602
[fdo#105763]: https://bugs.freedesktop.org/show_bug.cgi?id=105763
[fdo#107383]: https://bugs.freedesktop.org/show_bug.cgi?id=107383
[fdo#107807]: https://bugs.freedesktop.org/show_bug.cgi?id=107807
[fdo#107815]: https://bugs.freedesktop.org/show_bug.cgi?id=107815
[fdo#107931]: https://bugs.freedesktop.org/show_bug.cgi?id=107931
[fdo#108145]: https://bugs.freedesktop.org/show_bug.cgi?id=108145
[fdo#108147]: https://bugs.freedesktop.org/show_bug.cgi?id=108147
[fdo#108954]: https://bugs.freedesktop.org/show_bug.cgi?id=108954
[fdo#109247]: https://bugs.freedesktop.org/show_bug.cgi?id=109247
[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[fdo#109274]: https://bugs.freedesktop.org/show_bug.cgi?id=109274
[fdo#109276]: https://bugs.freedesktop.org/show_bug.cgi?id=109276
[fdo#109278]: https://bugs.freedesktop.org/show_bug.cgi?id=109278
[fdo#109280]: https://bugs.freedesktop.org/show_bug.cgi?id=109280
[fdo#109301]: https://bugs.freedesktop.org/show_bug.cgi?id=109301
[fdo#109441]: https://bugs.freedesktop.org/show_bug.cgi?id=109441
[fdo#109593]: https://bugs.freedesktop.org/show_bug.cgi?id=109593
[fdo#109633]: https://bugs.freedesktop.org/show_bug.cgi?id=109633
[fdo#109642]: https://bugs.freedesktop.org/show_bug.cgi?id=109642
[fdo#110025]: https://bugs.freedesktop.org/show_bug.cgi?id=110025
[fdo#110215]: https://bugs.freedesktop.org/show_bug.cgi?id=110215
[fdo#110222]: https://bugs.freedesktop.org/show_bug.cgi?id=110222
[fdo#99912]: https://bugs.freedesktop.org/show_bug.cgi?id=99912
[k.org#198133]: https://bugzilla.kernel.org/show_bug.cgi?id=198133

Participating hosts (10 -> 9)
------------------------------

Missing (1): shard-hsw

Build changes
-------------

* Linux: CI_DRM_5815 -> Patchwork_12598

CI_DRM_5815: 472ba88b1a76be18fb4ca6d688d6c5cda08cec81 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_4904: b9cfd64009ca2536f7a997deabf34d88f2757511 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_12598: b83064aeff50e708c9d827df85747ecdbc889d7b @ git://anongit.freedesktop.org/gfx-ci/linux
piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_12598/
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx