Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 03BF2EDEC4D for ; Wed, 13 Sep 2023 13:08:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240728AbjIMNII (ORCPT ); Wed, 13 Sep 2023 09:08:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37064 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240761AbjIMNIH (ORCPT ); Wed, 13 Sep 2023 09:08:07 -0400 Received: from www.linuxtv.org (www.linuxtv.org [130.149.80.248]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B8B0E19B6 for ; Wed, 13 Sep 2023 06:08:03 -0700 (PDT) Received: from mchehab by www.linuxtv.org with local (Exim 4.92) (envelope-from ) id 1qgPb7-003itD-FC; Wed, 13 Sep 2023 13:08:01 +0000 From: Mauro Carvalho Chehab Date: Fri, 28 Jul 2023 08:20:10 +0000 Subject: [git:media_stage/master] media: uvcvideo: Fix menu count handling for userspace XU mappings To: linuxtv-commits@linuxtv.org Cc: Ricardo Ribalda , Laurent Pinchart , stable@vger.kernel.org Mail-followup-to: linux-media@vger.kernel.org Forward-to: linux-media@vger.kernel.org Reply-to: linux-media@vger.kernel.org Message-Id: Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org This is an automatic generated email to let you know that the following patch were queued: Subject: media: uvcvideo: Fix menu count handling for userspace XU mappings Author: Laurent Pinchart Date: Tue Jun 6 18:55:30 2023 +0200 When commit 716c330433e3 ("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 Fixes: 716c330433e3 ("media: uvcvideo: Use standard names for menus") Signed-off-by: Laurent Pinchart Reviewed-by: Ricardo Ribalda Signed-off-by: Mauro Carvalho Chehab drivers/media/usb/uvc/uvc_v4l2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- diff --git a/drivers/media/usb/uvc/uvc_v4l2.c b/drivers/media/usb/uvc/uvc_v4l2.c index 5ac2a424b13d..f4988f03640a 100644 --- a/drivers/media/usb/uvc/uvc_v4l2.c +++ b/drivers/media/usb/uvc/uvc_v4l2.c @@ -45,7 +45,7 @@ static int uvc_control_add_xu_mapping(struct uvc_video_chain *chain, map->menu_names = NULL; map->menu_mapping = NULL; - map->menu_mask = BIT_MASK(xmap->menu_count); + map->menu_mask = GENMASK(xmap->menu_count - 1, 0); size = xmap->menu_count * sizeof(*map->menu_mapping); map->menu_mapping = kzalloc(size, GFP_KERNEL);