Re: [Intel-gfx] [PATCH] drm/i915/selftests: Fix uninitialized variable

2020-03-04 Thread Jani Nikula
On Wed, 04 Mar 2020, Jani Nikula wrote: > On Tue, 03 Mar 2020, Matt Roper wrote: >> On Tue, Mar 03, 2020 at 05:25:21PM +0200, Jani Nikula wrote: >>> On Tue, 03 Mar 2020, Aditya Swarup wrote: >>> > - struct lrc_timestamp data; >>> > + struct lrc_timestamp data = { 0 }; >>> >>> {} is preferred ov

Re: [Intel-gfx] [PATCH] drm/i915/selftests: Fix uninitialized variable

2020-03-04 Thread Jani Nikula
On Tue, 03 Mar 2020, Matt Roper wrote: > On Tue, Mar 03, 2020 at 05:25:21PM +0200, Jani Nikula wrote: >> On Tue, 03 Mar 2020, Aditya Swarup wrote: >> > - struct lrc_timestamp data; >> > + struct lrc_timestamp data = { 0 }; >> >> {} is preferred over {0}. > > Is there a reference for this (e.g.

Re: [Intel-gfx] [PATCH] drm/i915/selftests: Fix uninitialized variable

2020-03-03 Thread Matt Roper
On Tue, Mar 03, 2020 at 05:25:21PM +0200, Jani Nikula wrote: > On Tue, 03 Mar 2020, Aditya Swarup wrote: > > Static code analysis tool identified struct lrc_timestamp data as being > > uninitialized and then data.ce[] is being checked for NULL/negative > > value in the error path. Initializing dat

Re: [Intel-gfx] [PATCH] drm/i915/selftests: Fix uninitialized variable

2020-03-03 Thread Matt Roper
On Tue, Mar 03, 2020 at 06:23:47AM -0800, Aditya Swarup wrote: > Static code analysis tool identified struct lrc_timestamp data as being > uninitialized and then data.ce[] is being checked for NULL/negative > value in the error path. Initializing data variable fixes the issue. > > Cc: Matt Roper

Re: [Intel-gfx] [PATCH] drm/i915/selftests: Fix uninitialized variable

2020-03-03 Thread Jani Nikula
On Tue, 03 Mar 2020, Aditya Swarup wrote: > Static code analysis tool identified struct lrc_timestamp data as being > uninitialized and then data.ce[] is being checked for NULL/negative > value in the error path. Initializing data variable fixes the issue. > > Cc: Matt Roper > Cc: Chris Wilson >

[Intel-gfx] [PATCH] drm/i915/selftests: Fix uninitialized variable

2020-03-03 Thread Aditya Swarup
Static code analysis tool identified struct lrc_timestamp data as being uninitialized and then data.ce[] is being checked for NULL/negative value in the error path. Initializing data variable fixes the issue. Cc: Matt Roper Cc: Chris Wilson Signed-off-by: Aditya Swarup --- drivers/gpu/drm/i915

Re: [Intel-gfx] [PATCH] drm/i915/selftests: Fix uninitialized variable

2018-04-24 Thread Gustavo A. R. Silva
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

Re: [Intel-gfx] [PATCH] drm/i915/selftests: Fix uninitialized variable

2018-04-24 Thread Chris Wilson
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 th

[Intel-gfx] [PATCH] drm/i915/selftests: Fix uninitialized variable

2018-04-24 Thread 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

Re: [Intel-gfx] [PATCH] drm/i915/selftests: Fix uninitialized variable

2018-04-24 Thread Chris Wilson
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. Whi