Skip to content

Commit 6d00f4e

Browse files
pinchartlmchehab
authored andcommitted
media: uvcvideo: Fix menu count handling for userspace XU mappings
When commit 716c330 ("media: uvcvideo: Use standard names for menus") reworked the handling of menu controls, it inadvertently replaced a GENMASK(n - 1, 0) with a BIT_MASK(n). The latter isn't equivalent to the former, which broke adding XU mappings from userspace. Fix it. Link: https://lore.kernel.org/linux-media/468a36ec-c3ac-cb47-e12f-5906239ae3cd@spahan.ch/ Cc: stable@vger.kernel.org Reported-by: Poncho <poncho@spahan.ch> Fixes: 716c330 ("media: uvcvideo: Use standard names for menus") Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Ricardo Ribalda <ribalda@chromium.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
1 parent 8329d0c commit 6d00f4e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/media/usb/uvc/uvc_v4l2.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ static int uvc_control_add_xu_mapping(struct uvc_video_chain *chain,
4545
map->menu_names = NULL;
4646
map->menu_mapping = NULL;
4747

48-
map->menu_mask = BIT_MASK(xmap->menu_count);
48+
map->menu_mask = GENMASK(xmap->menu_count - 1, 0);
4949

5050
size = xmap->menu_count * sizeof(*map->menu_mapping);
5151
map->menu_mapping = kzalloc(size, GFP_KERNEL);

0 commit comments

Comments
 (0)