Re: [PATCH] drm/atmel_hlcdc: Fix uninitialized variable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 10/4/24 09:08, Advait Dhamorikar wrote:
atmel_hlcdc_plane_update_buffers: may use an uninitialized
sr variable when the if condition remains unsatisfied


As mentioned in my response to another one of your patches,
include how you found the problem in the change log.

Signed-off-by: Advait Dhamorikar <advaitdhamorikar@xxxxxxxxx>
---
  drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c
index 4a7ba0918eca..4150c4d0b4f2 100644
--- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c
+++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c
@@ -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)

sr could be used uninitialized in the for loop, !dc->desc->is_xlcdc
case. However, is 0 the right initialization for this value?

thanks,
-- Shuah



[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux