All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915/selftests: Fix uninitialized variable
@ 2018-04-24 13:15 Gustavo A. R. Silva
  2018-04-24 13:22   ` Chris Wilson
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Gustavo A. R. Silva @ 2018-04-24 13:15 UTC (permalink / raw)
  To: Chris Wilson, Jani Nikula, Joonas Lahtinen, Rodrigo Vivi, David Airlie
  Cc: intel-gfx, dri-devel, linux-kernel, Gustavo A. R. Silva

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")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
 drivers/gpu/drm/i915/selftests/intel_workarounds.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/selftests/intel_workarounds.c b/drivers/gpu/drm/i915/selftests/intel_workarounds.c
index 5455b26..17444a3 100644
--- a/drivers/gpu/drm/i915/selftests/intel_workarounds.c
+++ b/drivers/gpu/drm/i915/selftests/intel_workarounds.c
@@ -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 */
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH] drm/i915/selftests: Fix uninitialized variable
  2018-04-24 13:15 [PATCH] drm/i915/selftests: Fix uninitialized variable Gustavo A. R. Silva
@ 2018-04-24 13:22   ` Chris Wilson
  2018-04-24 15:26 ` ✓ Fi.CI.BAT: success for " Patchwork
  2018-04-24 19:02 ` ✗ Fi.CI.IGT: failure " Patchwork
  2 siblings, 0 replies; 10+ messages in thread
From: Chris Wilson @ 2018-04-24 13:22 UTC (permalink / raw)
  To: Gustavo A. R. Silva, Jani Nikula, Joonas Lahtinen, Rodrigo Vivi,
	David Airlie
  Cc: intel-gfx, dri-devel, linux-kernel, Gustavo A. R. Silva

Quoting Gustavo A. R. Silva (2018-04-24 14:15:45)
> 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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] drm/i915/selftests: Fix uninitialized variable
@ 2018-04-24 13:22   ` Chris Wilson
  0 siblings, 0 replies; 10+ messages in thread
From: Chris Wilson @ 2018-04-24 13:22 UTC (permalink / raw)
  To: Jani Nikula, Joonas Lahtinen, Rodrigo Vivi, David Airlie
  Cc: intel-gfx, dri-devel, linux-kernel, Gustavo A. R. Silva

Quoting Gustavo A. R. Silva (2018-04-24 14:15:45)
> 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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] drm/i915/selftests: Fix uninitialized variable
  2018-04-24 13:22   ` Chris Wilson
  (?)
@ 2018-04-24 13:30   ` Gustavo A. R. Silva
  2018-04-24 13:36       ` Chris Wilson
  -1 siblings, 1 reply; 10+ messages in thread
From: Gustavo A. R. Silva @ 2018-04-24 13:30 UTC (permalink / raw)
  To: Chris Wilson, Jani Nikula, Joonas Lahtinen, Rodrigo Vivi, David Airlie
  Cc: intel-gfx, dri-devel, linux-kernel



On 04/24/2018 08:22 AM, Chris Wilson wrote:
> Quoting Gustavo A. R. Silva (2018-04-24 14:15:45)
>> 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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] drm/i915/selftests: Fix uninitialized variable
  2018-04-24 13:30   ` Gustavo A. R. Silva
@ 2018-04-24 13:36       ` Chris Wilson
  0 siblings, 0 replies; 10+ messages in thread
From: Chris Wilson @ 2018-04-24 13:36 UTC (permalink / raw)
  To: Gustavo A. R. Silva, Jani Nikula, Joonas Lahtinen, Rodrigo Vivi,
	David Airlie
  Cc: intel-gfx, dri-devel, linux-kernel

Quoting Gustavo A. R. Silva (2018-04-24 14:30:58)
> 
> 
> On 04/24/2018 08:22 AM, Chris Wilson wrote:
> > Quoting Gustavo A. R. Silva (2018-04-24 14:15:45)
> >> 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:


It would help if I read the right function. Ok,
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] drm/i915/selftests: Fix uninitialized variable
@ 2018-04-24 13:36       ` Chris Wilson
  0 siblings, 0 replies; 10+ messages in thread
From: Chris Wilson @ 2018-04-24 13:36 UTC (permalink / raw)
  To: Gustavo A. R. Silva, Jani Nikula, Joonas Lahtinen, Rodrigo Vivi,
	David Airlie
  Cc: intel-gfx, linux-kernel, dri-devel

Quoting Gustavo A. R. Silva (2018-04-24 14:30:58)
> 
> 
> On 04/24/2018 08:22 AM, Chris Wilson wrote:
> > Quoting Gustavo A. R. Silva (2018-04-24 14:15:45)
> >> 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:


It would help if I read the right function. Ok,
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 10+ messages in thread

* ✓ Fi.CI.BAT: success for drm/i915/selftests: Fix uninitialized variable
  2018-04-24 13:15 [PATCH] drm/i915/selftests: Fix uninitialized variable Gustavo A. R. Silva
  2018-04-24 13:22   ` Chris Wilson
@ 2018-04-24 15:26 ` Patchwork
  2018-04-24 19:02 ` ✗ Fi.CI.IGT: failure " Patchwork
  2 siblings, 0 replies; 10+ messages in thread
From: Patchwork @ 2018-04-24 15:26 UTC (permalink / raw)
  To: Gustavo A. R. Silva; +Cc: intel-gfx

== 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
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 10+ messages in thread

* ✗ Fi.CI.IGT: failure for drm/i915/selftests: Fix uninitialized variable
  2018-04-24 13:15 [PATCH] drm/i915/selftests: Fix uninitialized variable Gustavo A. R. Silva
  2018-04-24 13:22   ` Chris Wilson
  2018-04-24 15:26 ` ✓ Fi.CI.BAT: success for " Patchwork
@ 2018-04-24 19:02 ` Patchwork
  2018-04-24 19:42   ` Chris Wilson
  2 siblings, 1 reply; 10+ messages in thread
From: Patchwork @ 2018-04-24 19:02 UTC (permalink / raw)
  To: Gustavo A. R. Silva; +Cc: intel-gfx

== 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
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: ✗ Fi.CI.IGT: failure for drm/i915/selftests: Fix uninitialized variable
  2018-04-24 19:02 ` ✗ Fi.CI.IGT: failure " Patchwork
@ 2018-04-24 19:42   ` Chris Wilson
  2018-04-24 19:43     ` Gustavo A. R. Silva
  0 siblings, 1 reply; 10+ messages in thread
From: Chris Wilson @ 2018-04-24 19:42 UTC (permalink / raw)
  To: Patchwork, Gustavo A. R. Silva; +Cc: intel-gfx

Quoting Patchwork (2018-04-24 20:02:06)
> == 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

Not related (obviously!)

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: ✗ Fi.CI.IGT: failure for drm/i915/selftests: Fix uninitialized variable
  2018-04-24 19:42   ` Chris Wilson
@ 2018-04-24 19:43     ` Gustavo A. R. Silva
  0 siblings, 0 replies; 10+ messages in thread
From: Gustavo A. R. Silva @ 2018-04-24 19:43 UTC (permalink / raw)
  To: Chris Wilson, intel-gfx, Patchwork



On 04/24/2018 02:42 PM, Chris Wilson wrote:
> Quoting Patchwork (2018-04-24 20:02:06)
>> == 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
> 
> Not related (obviously!)
> 
> Thanks for the fixup, applied.
> -Chris
> 

Yep. I noticed that.

Glad to help. :)

Thanks
--
Gustavo
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2018-04-24 20:04 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-24 13:15 [PATCH] drm/i915/selftests: Fix uninitialized variable Gustavo A. R. Silva
2018-04-24 13:22 ` Chris Wilson
2018-04-24 13:22   ` Chris Wilson
2018-04-24 13:30   ` Gustavo A. R. Silva
2018-04-24 13:36     ` Chris Wilson
2018-04-24 13:36       ` Chris Wilson
2018-04-24 15:26 ` ✓ Fi.CI.BAT: success for " Patchwork
2018-04-24 19:02 ` ✗ Fi.CI.IGT: failure " Patchwork
2018-04-24 19:42   ` Chris Wilson
2018-04-24 19:43     ` Gustavo A. R. Silva

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.