Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp525115pxf; Wed, 17 Mar 2021 09:46:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyFKowhlPRD+kfVgNtOqzPgh3UfVL5VRkoG5TotLXREq7cDL3nQhwrz2Ym+F0TYTVIptd9B X-Received: by 2002:a17:906:b4c:: with SMTP id v12mr36768875ejg.330.1615999613370; Wed, 17 Mar 2021 09:46:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615999613; cv=none; d=google.com; s=arc-20160816; b=rCwnQe7ge53QlxHHKcVnARuR2Oa3yI4PskFE46Kt7w33hLdBFjjqQe46lf7NW39lt4 nxLyf30oa2l9wgNPnIBC7Q58jZcs42B4mdmVFEHPLQmRuVtcMbjnRiKQiL20O9m+D5jT O1RG6MJZLs1xjDYgBcy0HdLm5Jk1/+2HqnZr+0dCo6w5ge8eh3bWIf2WLhECXqHM6EgI PJ9OAa9fD6UbzLKPTzD4k1WLaOJZwo0VDLRC6RLl1x0flEL3r+W1SkPggxsffhXvqLgF AGZeeMNUU+XQ1kBOOUj7eRmM6UTDtifCgyG+eFuFM5f5C0uHaf4A+lUoqYO0m9HJQEqo uBIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=RsUSbbA0uHXEjQnHfQBh5T5niyqZj1SUeATSCdO5Phc=; b=eyPeyMhO133Im5HVTw8bet6cu8/Q2jGZXONCTsTQpSkMosOO9//740dvAgBc85q0wu bLFUkB/MmVP6jj9Z4mKhXaJObPKInASep/dajzlJozI+wPEnONO3IKYhQwRl5X00O2HR g0USiJxuRKUOv4Z1sYPN+Axi0lG/pPNqld4sogOGWNTnncjzxc5EnxTfDnzNJMG1zuxC /D+dvwMYQmJBuPSDWVM3PYnDiC+zmUONCMto/TDr69V7d3sbAOSqdTsYpTA/K8huZz48 l19aedTAZKiZPSE4lR5HEEaMGdov86NdUwpq99u/NoCLjWh6zzB2eK8sCkwUCsE/3azl R/Bg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=jg6ZPj1G; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m20si16238929edv.175.2021.03.17.09.46.29; Wed, 17 Mar 2021 09:46:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=jg6ZPj1G; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232614AbhCQQpe (ORCPT + 99 others); Wed, 17 Mar 2021 12:45:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56268 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232574AbhCQQpQ (ORCPT ); Wed, 17 Mar 2021 12:45:16 -0400 Received: from mail-ej1-x633.google.com (mail-ej1-x633.google.com [IPv6:2a00:1450:4864:20::633]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8762AC06174A for ; Wed, 17 Mar 2021 09:45:16 -0700 (PDT) Received: by mail-ej1-x633.google.com with SMTP id bm21so3699876ejb.4 for ; Wed, 17 Mar 2021 09:45:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=RsUSbbA0uHXEjQnHfQBh5T5niyqZj1SUeATSCdO5Phc=; b=jg6ZPj1GHBpg+UNu/STxxmogka909uzVVaw+ssSVXAdM/KMtvydNTh88SL+rFl8xMH +QfuHHwPAzxYC2YmhThgtl813p63/Ry8nU/UskQir83ZmLPQXxSxACUDnkQC6eMNisRd 7QtVD6O7UFXWb4tsFPCVzueoAvMgOwjE9Uowo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=RsUSbbA0uHXEjQnHfQBh5T5niyqZj1SUeATSCdO5Phc=; b=WaB9CLEuT6EVJiSzC5xsoG1+R81qIyuhHxaG94Bvj3CFPGjAlYmczn32e/lHyx0jYD dNRVL9wY+F9I8xgYxfTNkLfgG745oQsSU0DMQTPe5uw7MSxuctNMjPuVV7y1oD8qQHiO nIsx9dFTnyQ+l0vS4qk1RZsyns0PuigppTFWAKH0eztUvl/wIPMeXIw+RLZAXlpq+84L jSd6nWxLZZo3DVaSYPL//7kvg4JMrnGNdYLEBIEmPVEUktoAH8q4FL9jPWnexiMHTz4l ohO7puAHgzMPBjPmxA2u+bVcJCpupGr7O37Oe7sJRCQvubCeGqXqBS9JsUAQsdP+i1rL xRJA== X-Gm-Message-State: AOAM53173iAmMDQ80UW066h+Nf/bcaSB6/D/frd3BnFBr8RAqPc40S5f m1BoOfL4feHvMxnDEmz2WPSP/w== X-Received: by 2002:a17:906:fc1c:: with SMTP id ov28mr36496205ejb.342.1615999515294; Wed, 17 Mar 2021 09:45:15 -0700 (PDT) Received: from alco.lan ([80.71.134.83]) by smtp.gmail.com with ESMTPSA id hy25sm12088128ejc.119.2021.03.17.09.45.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Mar 2021 09:45:15 -0700 (PDT) From: Ricardo Ribalda To: Laurent Pinchart , Mauro Carvalho Chehab , Hans Verkuil , Sergey Senozhatsky , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, tfiga@chromium.org Cc: Ricardo Ribalda , stable@vger.kernel.org Subject: [PATCH v6 02/17] media: v4l2-ioctl: check_ext_ctrls: Return -EINVAL on V4L2_CTRL_WHICH_REQUEST_VAL Date: Wed, 17 Mar 2021 17:44:56 +0100 Message-Id: <20210317164511.39967-3-ribalda@chromium.org> X-Mailer: git-send-email 2.31.0.rc2.261.g7f71774620-goog In-Reply-To: <20210317164511.39967-1-ribalda@chromium.org> References: <20210317164511.39967-1-ribalda@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Drivers that do not use the ctrl-framework use this function instead. - Return -EINVAL for request_api calls Fixes v4l2-compliance: Buffer ioctls (Input 0): fail: v4l2-test-buffers.cpp(1994): ret != EINVAL && ret != EBADR && ret != ENOTTY test Requests: FAIL Cc: stable@vger.kernel.org Fixes: 6fa6f831f095 ("media: v4l2-ctrls: add core request support") Signed-off-by: Ricardo Ribalda --- drivers/media/v4l2-core/v4l2-ioctl.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c index 403f957a1012..76e2e595d88d 100644 --- a/drivers/media/v4l2-core/v4l2-ioctl.c +++ b/drivers/media/v4l2-core/v4l2-ioctl.c @@ -931,6 +931,8 @@ static bool check_ext_ctrls(struct v4l2_ext_controls *c, unsigned long ioctl) case V4L2_CTRL_WHICH_DEF_VAL: case V4L2_CTRL_WHICH_CUR_VAL: return true; + case V4L2_CTRL_WHICH_REQUEST_VAL: + return false; } /* Check that all controls are from the same control class. */ -- 2.31.0.rc2.261.g7f71774620-goog