LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH][next] drm/i915: fix uninitialized variable 'subslice_mask'
@ 2019-05-29 14:43 Colin King
  2019-05-29 15:04 ` Jani Nikula
  0 siblings, 1 reply; 3+ messages in thread
From: Colin King @ 2019-05-29 14:43 UTC (permalink / raw)
  To: Jani Nikula, Joonas Lahtinen, Rodrigo Vivi, David Airlie,
	Daniel Vetter, intel-gfx, dri-devel
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

Currently subslice_mask is not initialized and so data is being
bit-wise or'd into a garbage value. Fix this by inintializing
subslice_mask to zero.

Addresses-Coverity: ("Uninitialized scalar variable")
Fixes: 1ac159e23c2c ("drm/i915: Expand subslice mask")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/gpu/drm/i915/intel_device_info.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/intel_device_info.c b/drivers/gpu/drm/i915/intel_device_info.c
index 3625f777f3a3..d395a09b994f 100644
--- a/drivers/gpu/drm/i915/intel_device_info.c
+++ b/drivers/gpu/drm/i915/intel_device_info.c
@@ -298,7 +298,7 @@ static void cherryview_sseu_info_init(struct drm_i915_private *dev_priv)
 {
 	struct sseu_dev_info *sseu = &RUNTIME_INFO(dev_priv)->sseu;
 	u32 fuse;
-	u8 subslice_mask;
+	u8 subslice_mask = 0;
 
 	fuse = I915_READ(CHV_FUSE_GT);
 
-- 
2.20.1


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

* Re: [PATCH][next] drm/i915: fix uninitialized variable 'subslice_mask'
  2019-05-29 15:04 ` Jani Nikula
@ 2019-05-29 15:04   ` Colin Ian King
  0 siblings, 0 replies; 3+ messages in thread
From: Colin Ian King @ 2019-05-29 15:04 UTC (permalink / raw)
  To: Jani Nikula, Joonas Lahtinen, Rodrigo Vivi, David Airlie,
	Daniel Vetter, intel-gfx, dri-devel
  Cc: kernel-janitors, linux-kernel, Stuart Summers, Daniele Ceraolo Spurio

On 29/05/2019 16:04, Jani Nikula wrote:
> On Wed, 29 May 2019, Colin King <colin.king@canonical.com> wrote:
>> From: Colin Ian King <colin.king@canonical.com>
>>
>> Currently subslice_mask is not initialized and so data is being
>> bit-wise or'd into a garbage value. Fix this by inintializing
>> subslice_mask to zero.
>>
>> Addresses-Coverity: ("Uninitialized scalar variable")
>> Fixes: 1ac159e23c2c ("drm/i915: Expand subslice mask")
> 
> This was already reverted for other reasons. Need to be fixed on the
> next round. For future reference, please Cc: author and reviewers of the
> referenced commit.

OK, will do.

Thanks, Colin
> 
> BR,
> Jani.
> 
> 
>> Signed-off-by: Colin Ian King <colin.king@canonical.com>
>> ---
>>  drivers/gpu/drm/i915/intel_device_info.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/i915/intel_device_info.c b/drivers/gpu/drm/i915/intel_device_info.c
>> index 3625f777f3a3..d395a09b994f 100644
>> --- a/drivers/gpu/drm/i915/intel_device_info.c
>> +++ b/drivers/gpu/drm/i915/intel_device_info.c
>> @@ -298,7 +298,7 @@ static void cherryview_sseu_info_init(struct drm_i915_private *dev_priv)
>>  {
>>  	struct sseu_dev_info *sseu = &RUNTIME_INFO(dev_priv)->sseu;
>>  	u32 fuse;
>> -	u8 subslice_mask;
>> +	u8 subslice_mask = 0;
>>  
>>  	fuse = I915_READ(CHV_FUSE_GT);
> 


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

* Re: [PATCH][next] drm/i915: fix uninitialized variable 'subslice_mask'
  2019-05-29 14:43 [PATCH][next] drm/i915: fix uninitialized variable 'subslice_mask' Colin King
@ 2019-05-29 15:04 ` Jani Nikula
  2019-05-29 15:04   ` Colin Ian King
  0 siblings, 1 reply; 3+ messages in thread
From: Jani Nikula @ 2019-05-29 15:04 UTC (permalink / raw)
  To: Colin King, Joonas Lahtinen, Rodrigo Vivi, David Airlie,
	Daniel Vetter, intel-gfx, dri-devel
  Cc: kernel-janitors, linux-kernel, Stuart Summers, Daniele Ceraolo Spurio

On Wed, 29 May 2019, Colin King <colin.king@canonical.com> wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Currently subslice_mask is not initialized and so data is being
> bit-wise or'd into a garbage value. Fix this by inintializing
> subslice_mask to zero.
>
> Addresses-Coverity: ("Uninitialized scalar variable")
> Fixes: 1ac159e23c2c ("drm/i915: Expand subslice mask")

This was already reverted for other reasons. Need to be fixed on the
next round. For future reference, please Cc: author and reviewers of the
referenced commit.

BR,
Jani.


> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  drivers/gpu/drm/i915/intel_device_info.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_device_info.c b/drivers/gpu/drm/i915/intel_device_info.c
> index 3625f777f3a3..d395a09b994f 100644
> --- a/drivers/gpu/drm/i915/intel_device_info.c
> +++ b/drivers/gpu/drm/i915/intel_device_info.c
> @@ -298,7 +298,7 @@ static void cherryview_sseu_info_init(struct drm_i915_private *dev_priv)
>  {
>  	struct sseu_dev_info *sseu = &RUNTIME_INFO(dev_priv)->sseu;
>  	u32 fuse;
> -	u8 subslice_mask;
> +	u8 subslice_mask = 0;
>  
>  	fuse = I915_READ(CHV_FUSE_GT);

-- 
Jani Nikula, Intel Open Source Graphics Center

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

end of thread, other threads:[~2019-05-29 15:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-29 14:43 [PATCH][next] drm/i915: fix uninitialized variable 'subslice_mask' Colin King
2019-05-29 15:04 ` Jani Nikula
2019-05-29 15:04   ` Colin Ian King

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).