diff options
Diffstat (limited to 'drivers/media/video/uvc/uvc_v4l2.c')
-rw-r--r-- | drivers/media/video/uvc/uvc_v4l2.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/media/video/uvc/uvc_v4l2.c b/drivers/media/video/uvc/uvc_v4l2.c index 43b05a7ecdc..ad7e64ff3ad 100644 --- a/drivers/media/video/uvc/uvc_v4l2.c +++ b/drivers/media/video/uvc/uvc_v4l2.c | |||
@@ -46,6 +46,8 @@ static int uvc_v4l2_query_menu(struct uvc_video_device *video, | |||
46 | struct uvc_menu_info *menu_info; | 46 | struct uvc_menu_info *menu_info; |
47 | struct uvc_control_mapping *mapping; | 47 | struct uvc_control_mapping *mapping; |
48 | struct uvc_control *ctrl; | 48 | struct uvc_control *ctrl; |
49 | u32 index = query_menu->index; | ||
50 | u32 id = query_menu->id; | ||
49 | 51 | ||
50 | ctrl = uvc_find_control(video, query_menu->id, &mapping); | 52 | ctrl = uvc_find_control(video, query_menu->id, &mapping); |
51 | if (ctrl == NULL || mapping->v4l2_type != V4L2_CTRL_TYPE_MENU) | 53 | if (ctrl == NULL || mapping->v4l2_type != V4L2_CTRL_TYPE_MENU) |
@@ -54,6 +56,10 @@ static int uvc_v4l2_query_menu(struct uvc_video_device *video, | |||
54 | if (query_menu->index >= mapping->menu_count) | 56 | if (query_menu->index >= mapping->menu_count) |
55 | return -EINVAL; | 57 | return -EINVAL; |
56 | 58 | ||
59 | memset(query_menu, 0, sizeof(*query_menu)); | ||
60 | query_menu->id = id; | ||
61 | query_menu->index = index; | ||
62 | |||
57 | menu_info = &mapping->menu_info[query_menu->index]; | 63 | menu_info = &mapping->menu_info[query_menu->index]; |
58 | strlcpy(query_menu->name, menu_info->name, sizeof query_menu->name); | 64 | strlcpy(query_menu->name, menu_info->name, sizeof query_menu->name); |
59 | return 0; | 65 | return 0; |