drm/atmel_hlcdc: Fix uninitialized variable
PATCH 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
--- 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
@@ -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
Quoted 3 lines · Advait Dhamorikar
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.
Quoted 18 lines
Signed-off-by Advait Dhamorikar <[email protected]>--- 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@@ -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;
Quoted 1 line
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
[email protected]
maintainerHi Shuah and Advait,
Quoted 11 lines · Shuah Khan
EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
Quoted 3 lines · Advait Dhamorikar
atmel_hlcdc_plane_update_buffers: may use an uninitialized sr variable when the if condition remains unsatisfiedAs mentioned in my response to another one of your patches, include how you found the problem in the change log.
This is smatch warning reported by Dan and Kernel Test Robot. Kindly add the tags mentioned in the below link in the next version.
https://lore.kernel.org/oe-kbuild/[email protected]/
Quoted 18 lines
Quoted 17 lines
Signed-off-by Advait Dhamorikar <[email protected]>---
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@@ -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;
Quoted 7 lines
Quoted 3 lines
drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c +0
-0int 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?
initializing sr to 0 is the right way
Thank you for taking care of the same
Quoted 2 lines
thanks,
-- Shuah
Signature · 2 lines
Thanks and Regards, Manikandan M.