From patchwork Fri Nov 3 07:39:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 13444393 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 426EBC4167D for ; Fri, 3 Nov 2023 07:39:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346151AbjKCHjg (ORCPT ); Fri, 3 Nov 2023 03:39:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43466 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233449AbjKCHjf (ORCPT ); Fri, 3 Nov 2023 03:39:35 -0400 Received: from mail-ej1-x636.google.com (mail-ej1-x636.google.com [IPv6:2a00:1450:4864:20::636]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A5FC019D for ; Fri, 3 Nov 2023 00:39:29 -0700 (PDT) Received: by mail-ej1-x636.google.com with SMTP id a640c23a62f3a-9d242846194so258640766b.1 for ; Fri, 03 Nov 2023 00:39:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698997168; x=1699601968; darn=vger.kernel.org; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=U+1fX8kJBhzdwigodozxrwdBIS/K0K2HiycV1It+8hk=; b=el27EnVHz1u+nyGidUu54/BMxy3z8NplabwfkhQoTrRUdFShKr26BkBW4x9h3dlGsQ 2R8Y2Dp8osGgAZ4tlr2OR9citKoPZY9xtqk6eATM425CGoJihf6wb7GrysNkTVt6cvoZ XWI6oFhcJg4pyqPxIcU3GE9HN2X/3bNebC+gb++OHU4wWQQw/36Tm5LmJGpBka+C1h+g akEYOj0L4RXeQuCb9CKqbkRj5AvhiX/xLUebn3Ch43PBTh0uxXtQy7Cv6gZYFGPzpwP9 1/ur9sAhdQ0L5S9mB7rXynLXiS/ZwsT9y9ELIwp/Pzt185dTUhlt9pjytWZxXIW80j1d 1fqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698997168; x=1699601968; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=U+1fX8kJBhzdwigodozxrwdBIS/K0K2HiycV1It+8hk=; b=Wl/yChtuC9Gfl7NhsAAMeUIc3xpUiEnwYxmWF5uRvYeJAQzLoNDgG35hpZTZ38sKX6 qIWzGJzbuTE5104YCy6HnPsBEyR1ZhEcL/VACuogDWih8sf/KSDmfzqf5HD2Z6JaT4OQ yV4DMRcUMqK9iCLMnHtR2F71yTm5+q2mET7BufVPju8EOX26nK8ht/E6kZMJ90npJ4r6 4vEW1V60M7xpef7ZS8BK5kvSpLJvB8VSgSmmMi8xidNJXi+vpL0VQMVsqlC7xvhTiDI1 OAdGNEmERxbf72wJD6okDp3ndAbCZBZLQZ/QxwNXEmUd7Wlf1Sm7rDmjw38s1oFEHGdt Hgvg== X-Gm-Message-State: AOJu0Yy/2maYsg4tjG18YmzPzYEDJ3hcGrp6tK75ugnStT3x4w/DRcZs 6d11ujNmiFz5KiY7TN80A/PKfA== X-Google-Smtp-Source: AGHT+IG3OoW+Xxvx6gQD2giIbs91cb1d56EdFI8iHQYAo+XeIp+1JHaoMLP9xUiLWRXwXnMXYSe0Qg== X-Received: by 2002:a17:907:86a7:b0:9be:ab38:a367 with SMTP id qa39-20020a17090786a700b009beab38a367mr6724881ejc.16.1698997168135; Fri, 03 Nov 2023 00:39:28 -0700 (PDT) Received: from localhost ([102.36.222.112]) by smtp.gmail.com with ESMTPSA id n5-20020a170906840500b0099ddc81903asm591965ejx.221.2023.11.03.00.39.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Nov 2023 00:39:27 -0700 (PDT) Date: Fri, 3 Nov 2023 10:39:24 +0300 From: Dan Carpenter To: Tomi Valkeinen Cc: Mauro Carvalho Chehab , Sakari Ailus , Laurent Pinchart , linux-media@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH v2] media: v4l2-subdev: Fix a 64bit bug Message-ID: MIME-Version: 1.0 Content-Disposition: inline X-Mailer: git-send-email haha only kidding Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org The problem is this line here from subdev_do_ioctl(). client_cap->capabilities &= ~V4L2_SUBDEV_CLIENT_CAP_STREAMS; The "client_cap->capabilities" variable is a u64. The AND operation is supposed to clear out the V4L2_SUBDEV_CLIENT_CAP_STREAMS flag. But because it's a 32 bit variable it accidentally clears out the high 32 bits as well. Currently we only use the first bit and none of the upper bits so this doesn't affect runtime behavior. Fixes: f57fa2959244 ("media: v4l2-subdev: Add new ioctl for client capabilities") Signed-off-by: Dan Carpenter Reviewed-by: Tomi Valkeinen --- v2: Don't use BIT_ULL() because this is UAPI. Also fix a couple typos in the commit message. include/uapi/linux/v4l2-subdev.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/uapi/linux/v4l2-subdev.h b/include/uapi/linux/v4l2-subdev.h index 4a195b68f28f..b383c2fe0cf3 100644 --- a/include/uapi/linux/v4l2-subdev.h +++ b/include/uapi/linux/v4l2-subdev.h @@ -239,7 +239,7 @@ struct v4l2_subdev_routing { * set (which is the default), the 'stream' fields will be forced to 0 by the * kernel. */ - #define V4L2_SUBDEV_CLIENT_CAP_STREAMS (1U << 0) + #define V4L2_SUBDEV_CLIENT_CAP_STREAMS (1ULL << 0) /** * struct v4l2_subdev_client_capability - Capabilities of the client accessing