Skip to contentSkip to conversation

drm/atmel_hlcdc: Fix uninitialized variable

PATCH In review Advait Dhamorikar 3 participants 4 messages Oct 7, 2024 – Dec 5, 2024

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

PATCH v2 1/1 drm/atmel_hlcdc: Fix uninitialized variable

atmel_hlcdc_plane_update_buffers: may use an uninitialized
sr variable when the if condition remains unsatisfied.
The variable may contain an arbitrary value left from earlier computations.

---
v1->v2: add reported by and closes labels

 drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c +1 -1
index 4a7ba0918eca..4150c4d0b4f2 100644
@@ -559,7 +559,7 @@ static void atmel_hlcdc_plane_update_buffers(struct atmel_hlcdc_plane *plane,
 	const struct atmel_hlcdc_layer_desc *desc = plane->layer.desc;
 	struct atmel_hlcdc_dc *dc = plane->base.dev->dev_private;
 	struct drm_framebuffer *fb = state->base.fb;
-	u32 sr;
+	u32 sr = 0;
 	int i;
 
 	if (!dc->desc->is_xlcdc)
Signature · 1 line
2.34.1
maintainer Reviewed-by on v2 1/1
#1 lore raw
Quoted 10 lines · Advait Dhamorikar

EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe

atmel_hlcdc_plane_update_buffers: may use an uninitialized
sr variable when the if condition remains unsatisfied.
The variable may contain an arbitrary value left from earlier computations.

Quoted 22 lines

---
v1->v2: add reported by and closes labels

  drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c +1 -2
index 4a7ba0918eca..4150c4d0b4f2 100644
@@ -559,7 +559,7 @@ static void atmel_hlcdc_plane_update_buffers(struct atmel_hlcdc_plane *plane,
         const struct atmel_hlcdc_layer_desc *desc = plane->layer.desc;
         struct atmel_hlcdc_dc *dc = plane->base.dev->dev_private;
         struct drm_framebuffer *fb = state->base.fb;
-       u32 sr;
+       u32 sr = 0;
         int i;
 
         if (!dc->desc->is_xlcdc)
--

2.34.1

Signature · 2 lines
Thanks and Regards,
Manikandan M.
Reviewed-by on v2 1/1
#2 lore raw
In reply to Advait Dhamorikar
Quoted 8 lines · Advait Dhamorikar

atmel_hlcdc_plane_update_buffers: may use an uninitialized
sr variable when the if condition remains unsatisfied.
The variable may contain an arbitrary value left from earlier computations.

Fixes d498771b0b83 ("drm: atmel_hlcdc: Add support for XLCDC using IP specific driver ops")
Signature · 2 lines
With best wishes
Dmitry
#3 lore raw

Hello,

Just a gentle ping, this patch was never applied.
Is there something more that needs to be done?

Thanks and regards,
Advait

Quoted 18 lines · Dmitry Baryshkov
Quoted 8 lines · Advait Dhamorikar

atmel_hlcdc_plane_update_buffers: may use an uninitialized
sr variable when the if condition remains unsatisfied.
The variable may contain an arbitrary value left from earlier computations.

Fixes d498771b0b83 ("drm: atmel_hlcdc: Add support for XLCDC using IP specific driver ops")

--
With best wishes
Dmitry