drivers/video: fix build error on CONFIG_DEBUG_OPTLEVEL="-O3"

Summary
The following compilation error occurs after configuring CONFIG_DEBUG_OPTLEVEL="-O3"
CC:  ping.c video/video.c: In function 'video_ioctl':
video/video.c:2347:22: error: 'control.size' may be used uninitialized [-Werror=maybe-uninitialized]
 2347 |               control->size,
      |                      ^~
video/video.c:2273:28: note: 'control' declared here
 2273 |   struct v4l2_ext_control  control;
      |                            ^~~~~~~

Signed-off-by: wangming9 <wangming9@xiaomi.com>
This commit is contained in:
wangming9 2023-08-30 21:55:31 +08:00 committed by Petro Karashchenko
parent 21c30f80af
commit f05e72324c
1 changed files with 3 additions and 0 deletions

View File

@ -2276,6 +2276,9 @@ static int video_g_ctrl(FAR struct video_mng_s *priv,
struct v4l2_ext_control control;
int ret;
memset(&ext_controls, 0, sizeof(struct v4l2_ext_controls));
memset(&control, 0, sizeof(struct v4l2_ext_control));
if (ctrl == NULL)
{
return -EINVAL;