mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-02-12 06:21:45 -05:00
V4L/DVB (11574): uvcvideo: fill reserved fields with zero of VIDIOC_QUERYMENU
When querying menu items with VIDIOC_QUERYMENU the reserved field
is not set to zero as required by V4L2 API revision 0.24 [1].
Add this fill.
The patch was tested with v4l-test 0.11 [2] with CNF7129 webcam found
on EeePC 901.
References:
[1] V4L2 API specification, revision 0.24
http://v4l2spec.bytesex.org/spec/r13317.htm#V4L2-QUERYMENU
[2] v4l-test: Test environment for Video For Linux Two API
http://v4l-test.sourceforge.net/
[Modified by Laurent Pinchart]
Use u32 instead of __u32 in non-exported kernel code.
Signed-off-by: Márton Németh <nm127@freemail.hu>
Signed-off-by: Laurent Pinchart <laurent.pinchart@skynet.be>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This commit is contained in:
committed by
Mauro Carvalho Chehab
parent
9086c7b994
commit
2460cdac94
@@ -46,6 +46,8 @@ static int uvc_v4l2_query_menu(struct uvc_video_device *video,
|
||||
struct uvc_menu_info *menu_info;
|
||||
struct uvc_control_mapping *mapping;
|
||||
struct uvc_control *ctrl;
|
||||
u32 index = query_menu->index;
|
||||
u32 id = query_menu->id;
|
||||
|
||||
ctrl = uvc_find_control(video, query_menu->id, &mapping);
|
||||
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,
|
||||
if (query_menu->index >= mapping->menu_count)
|
||||
return -EINVAL;
|
||||
|
||||
memset(query_menu, 0, sizeof(*query_menu));
|
||||
query_menu->id = id;
|
||||
query_menu->index = index;
|
||||
|
||||
menu_info = &mapping->menu_info[query_menu->index];
|
||||
strlcpy(query_menu->name, menu_info->name, sizeof query_menu->name);
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user