Skip to content

Commit

Permalink
media: sun6i-isp: capture: Fix uninitialized variable use
Browse files Browse the repository at this point in the history
While the stride_chroma variable was previously initialized to zero,
it's actually stride_chroma_div4 that is set to hardware registers.

Initialize it to zero instead to avoid an uninitialized variable use
and get rid of the associated smatch warning.

Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
Fixes: e3185e1 ("media: staging: media: Add support for the Allwinner A31 ISP")
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
  • Loading branch information
Paul Kocialkowski authored and Mauro Carvalho Chehab committed Dec 14, 2022
1 parent 44723b8 commit 7266eb7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/staging/media/sunxi/sun6i-isp/sun6i_isp_capture.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ sun6i_isp_capture_buffer_configure(struct sun6i_isp_device *isp_dev,
void sun6i_isp_capture_configure(struct sun6i_isp_device *isp_dev)
{
unsigned int width, height;
unsigned int stride_luma, stride_chroma = 0;
unsigned int stride_luma_div4, stride_chroma_div4;
unsigned int stride_luma, stride_chroma;
unsigned int stride_luma_div4, stride_chroma_div4 = 0;
const struct sun6i_isp_capture_format *format;
const struct v4l2_format_info *info;
u32 pixelformat;
Expand Down

0 comments on commit 7266eb7

Please sign in to comment.