summaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorJacopo Mondi <jacopo.mondi@ideasonboard.com>2023-08-10 15:33:37 +0200
committerMauro Carvalho Chehab <mchehab@kernel.org>2023-08-14 20:27:58 +0200
commit33c7ae8f49e3413c81e879e1fdfcea4c5516e37b (patch)
treef8c7fe642471401acee2627d72562006b02b53cb /drivers/media
parentmedia: coda: Remove duplicated include (diff)
downloadlinux-33c7ae8f49e3413c81e879e1fdfcea4c5516e37b.tar.xz
linux-33c7ae8f49e3413c81e879e1fdfcea4c5516e37b.zip
media: i2c: rdacm21: Fix uninitialized value
Fix the following smatch warning: drivers/media/i2c/rdacm21.c:373 ov10640_check_id() error: uninitialized symbol 'val'. Initialize 'val' to 0 in the ov10640_check_id() function. Fixes: 2b821698dc73 ("media: i2c: rdacm21: Power up OV10640 before OV490") Reported-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/i2c/rdacm21.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/media/i2c/rdacm21.c b/drivers/media/i2c/rdacm21.c
index 3454f7d73121..a36a709243fd 100644
--- a/drivers/media/i2c/rdacm21.c
+++ b/drivers/media/i2c/rdacm21.c
@@ -351,7 +351,7 @@ static void ov10640_power_up(struct rdacm21_device *dev)
static int ov10640_check_id(struct rdacm21_device *dev)
{
unsigned int i;
- u8 val;
+ u8 val = 0;
/* Read OV10640 ID to test communications. */
for (i = 0; i < OV10640_PID_TIMEOUT; ++i) {