Skip to contentSkip to conversation

drm/i915/selftests: Fix uninitialized variable

PATCH In review Gustavo A. R. Silva 3 participants 8 messages Apr 24, 2018

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

PATCH 1/1 drm/i915/selftests: Fix uninitialized variable

There is a potential execution path in which variable err is returned without being properly initialized previously.

Fix this by initializing variable err to 0.

Addresses-Coverity-ID: 1468362 ("Uninitialized scalar variable")

Fixes f4ecfbfc32ed ("drm/i915: Check whitelist registers across resets")
---
 drivers/gpu/drm/i915/selftests/intel_workarounds.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/i915/selftests/intel_workarounds.c +1 -1
index 5455b26..17444a3 100644
@@ -239,7 +239,7 @@ static int live_reset_whitelist(void *arg)
 	struct intel_engine_cs *engine = i915->engine[RCS];
 	struct i915_gpu_error *error = &i915->gpu_error;
 	struct whitelist w;
-	int err;
+	int err = 0;
 
 	/* If we reset the gpu, we should not lose the RING_NONPRIV */
 
Signature · 1 line
2.7.4
#1 lore raw

Quoting Gustavo A. R. Silva (2018-04-24 14:15:45)

Quoted 4 lines

There is a potential execution path in which variable err is returned without being properly initialized previously.

Fix this by initializing variable err to 0.

err is only returned along an error path, returning 0 would not be useful. Which path? All the error paths look correct to me. -Chris

#2 lore raw
Quoted 10 lines · Chris Wilson

Quoting Gustavo A. R. Silva (2018-04-24 14:15:45)

Quoted 4 lines

There is a potential execution path in which variable err is returned without being properly initialized previously.

Fix this by initializing variable err to 0.

err is only returned along an error path, returning 0 would not be useful. Which path? All the error paths look correct to me. -Chris

If the following two conditions take the false branch then the function returns err with a random stack value:

if (intel_has_reset_engine(i915)) {
		...
}
if (intel_has_gpu_reset(i915)) {
		...
}

Thanks
--
Gustavo

Reviewed-by
#3 lore raw

Quoting Gustavo A. R. Silva (2018-04-24 14:30:58)

Quoted 9 lines · Chris Wilson
Quoted 6 lines

Quoting Gustavo A. R. Silva (2018-04-24 14:15:45)

Quoted 4 lines

There is a potential execution path in which variable err is returned without being properly initialized previously.

Fix this by initializing variable err to 0.

Quoted 7 lines
Quoted 4 lines

err is only returned along an error path, returning 0 would not be useful. Which path? All the error paths look correct to me. -Chris

If the following two conditions take the false branch then the function returns err with a random stack value:

It would help if I read the right function. Ok,

-Chris
_______________________________________________
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 uninitialized variable

In reply to Gustavo A. R. Silva
== Series Details ==

== Series Details ==

Series: drm/i915/selftests: Fix uninitialized variable
URL : https://patchwork.freedesktop.org/series/42194/
State : success

== Summary ==

= CI Bug Log - changes from CI_DRM_4087 -> Patchwork_8790 =

== Summary - SUCCESS ==

No regressions found.

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

== Changes ==

No changes found

== Participating hosts (37 -> 34) ==

Missing (3): fi-ctg-p8600 fi-ilk-m540 fi-skl-6700hq

== Build changes ==

* Linux: CI_DRM_4087 -> Patchwork_8790

CI_DRM_4087: d04fd4f6d93cea918521059db8358ff9e7a4a03b @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_4446: e5e8dafc991ee922ec159491c680caff0cfe9235 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_8790: 0fd599472ba7fbbc7f01f655f08a1a17965fd1a7 @ git://anongit.freedesktop.org/gfx-ci/linux
piglit_4446: a2f486679f467cd6e82578384f56d4aabaa8cf2e @ git://anongit.freedesktop.org/piglit

== Linux commits ==

0fd599472ba7 drm/i915/selftests: Fix uninitialized variable

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_8790/issues.html
_______________________________________________
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 uninitialized variable

In reply to Gustavo A. R. Silva
== Series Details ==

== Series Details ==

Series: drm/i915/selftests: Fix uninitialized variable
URL : https://patchwork.freedesktop.org/series/42194/
State : failure

== Summary ==

= CI Bug Log - changes from CI_DRM_4087_full -> Patchwork_8790_full =

== Summary - FAILURE ==

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

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

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

== Possible new issues ==

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

=== IGT changes ===

    ==== Possible regressions ====

    igt@prime_busy@wait-before-blt:
      shard-glk:          PASS -> FAIL

    
    ==== Warnings ====

    igt@gem_exec_schedule@deep-bsd1:
      shard-kbl:          SKIP -> PASS +2

    igt@kms_atomic_interruptible@legacy-cursor:
      shard-snb:          PASS -> SKIP +2

== Known issues ==

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

=== IGT changes ===

    ==== Issues hit ====

    igt@kms_flip@blocking-absolute-wf_vblank-interruptible:
      shard-glk:          PASS -> FAIL (fdo#106134)

    igt@kms_flip@plain-flip-ts-check:
      shard-hsw:          PASS -> FAIL (fdo#100368)

    igt@kms_sysfs_edid_timing:
      shard-apl:          PASS -> WARN (fdo#100047)

    
    ==== Possible fixes ====

    igt@gem_eio@in-flight-contexts-immediate:
      shard-glk:          FAIL -> PASS

    igt@gem_eio@in-flight-immediate:
      shard-glk:          FAIL (fdo#105957) -> PASS

    igt@kms_flip@dpms-vs-vblank-race-interruptible:
      shard-glk:          FAIL (fdo#103060) -> PASS

    igt@kms_flip@plain-flip-fb-recreate-interruptible:
      shard-glk:          FAIL (fdo#100368) -> PASS +2

    igt@kms_flip@plain-flip-ts-check-interruptible:
      shard-hsw:          FAIL (fdo#100368) -> PASS

    igt@kms_setmode@basic:
      shard-hsw:          FAIL (fdo#99912) -> PASS

fdo#100047 https://bugs.freedesktop.org/show_bug.cgi?id=100047
fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
fdo#103060 https://bugs.freedesktop.org/show_bug.cgi?id=103060
fdo#105957 https://bugs.freedesktop.org/show_bug.cgi?id=105957
fdo#106134 https://bugs.freedesktop.org/show_bug.cgi?id=106134
fdo#99912 https://bugs.freedesktop.org/show_bug.cgi?id=99912

== Participating hosts (6 -> 5) ==

Missing (1): shard-glkb

== Build changes ==

* Linux: CI_DRM_4087 -> Patchwork_8790

CI_DRM_4087: d04fd4f6d93cea918521059db8358ff9e7a4a03b @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_4446: e5e8dafc991ee922ec159491c680caff0cfe9235 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_8790: 0fd599472ba7fbbc7f01f655f08a1a17965fd1a7 @ git://anongit.freedesktop.org/gfx-ci/linux
piglit_4446: a2f486679f467cd6e82578384f56d4aabaa8cf2e @ git://anongit.freedesktop.org/piglit

== Logs ==

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

#6 lore raw

Re: ✗ Fi.CI.IGT: failure for drm/i915/selftests: Fix uninitialized variable

Quoting Patchwork (2018-04-24 20:02:06)

Quoted 23 lines

== Series Details ==

Series: drm/i915/selftests: Fix uninitialized variable
URL : https://patchwork.freedesktop.org/series/42194/
State : failure

== Summary ==

= CI Bug Log - changes from CI_DRM_4087_full -> Patchwork_8790_full =

== Summary - FAILURE ==

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

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

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

== Possible new issues ==

Quoted 8 lines

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

=== IGT changes ===

    ==== Possible regressions ====

    igt@prime_busy@wait-before-blt:
      shard-glk:          PASS -> FAIL

Not related (obviously!)

Thanks for the fixup, applied.
-Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#7 lore raw

Re: ✗ Fi.CI.IGT: failure for drm/i915/selftests: Fix uninitialized variable

Quoted 30 lines · Chris Wilson

Quoting Patchwork (2018-04-24 20:02:06)

Quoted 29 lines

== Series Details ==

Series: drm/i915/selftests: Fix uninitialized variable
URL : https://patchwork.freedesktop.org/series/42194/
State : failure

== Summary ==

= CI Bug Log - changes from CI_DRM_4087_full -> Patchwork_8790_full =

== Summary - FAILURE ==

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

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

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

== Possible new issues ==

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

   === IGT changes ===

     ==== Possible regressions ====
Quoted 8 lines
Quoted 2 lines
     igt@prime_busy@wait-before-blt:
       shard-glk:          PASS -> FAIL

Not related (obviously!)

Thanks for the fixup, applied.
-Chris

Yep. I noticed that.

Glad to help. :)

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