lkml.org 
[lkml]   [2018]   [Apr]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] drm/i915/selftests: Fix uninitialized variable
From
Date


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

\
 
 \ /
  Last update: 2018-04-24 15:31    [W:0.061 / U:0.200 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site