From patchwork Tue Oct 3 12:08:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sakari Ailus X-Patchwork-Id: 729437 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 5E744E75426 for ; Tue, 3 Oct 2023 12:08:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232124AbjJCMIb (ORCPT ); Tue, 3 Oct 2023 08:08:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57840 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232110AbjJCMIb (ORCPT ); Tue, 3 Oct 2023 08:08:31 -0400 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CB7BDA6 for ; Tue, 3 Oct 2023 05:08:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1696334907; x=1727870907; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=kVOii1f/5s2PJ8KVti6PipXSxyHHcLq5+5oOMw3hR+A=; b=Jo7TfE5J7l5cmPG9aEedYhGcU2yze8SGRF5kDJ7+CC5pS1LnDafUWzAs Ww4W8zeBUenfmleeTu88RmicM6F8Bjq05Xx8D5qDajDmrBhDekTq1/p8p waOtp8kXRRs7u5MRPqrDPPDkI6Vg/+oGcY7kU0Ul37vHO0Ic6u21n09/Y JxFja5RS4jrtjYRvDkRh4JDn8Jo0ioUiXGRVxVGLQrevV8R4YV5a1hoF7 KA6a5UhjisI+Mkqp9X/A3KW6IBZiuUWjh7pZPptiRQptVTmwPc8PCrPRB YcVQ0MrpEcV6CrAkxN7aK6OVheZPmqxzSGo8g6irGbveleb4A+1GSbwNv Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10851"; a="385681520" X-IronPort-AV: E=Sophos;i="6.03,197,1694761200"; d="scan'208";a="385681520" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Oct 2023 05:08:27 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10851"; a="780285914" X-IronPort-AV: E=Sophos;i="6.03,197,1694761200"; d="scan'208";a="780285914" Received: from turnipsi.fi.intel.com (HELO kekkonen.fi.intel.com) ([10.237.72.44]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Oct 2023 05:08:24 -0700 Received: from svinhufvud.ger.corp.intel.com (localhost [IPv6:::1]) by kekkonen.fi.intel.com (Postfix) with ESMTP id 13C12120797; Tue, 3 Oct 2023 15:08:20 +0300 (EEST) From: Sakari Ailus To: linux-media@vger.kernel.org Cc: Laurent Pinchart , tomi.valkeinen@ideasonboard.com, bingbu.cao@intel.com, hongju.wang@intel.com, hverkuil@xs4all.nl, Andrey Konovalov , Jacopo Mondi , Dmitry Perchanov , "Ng, Khai Wen" Subject: [PATCH v6 15/28] media: v4l: subdev: Copy argument back to user also for S_ROUTING Date: Tue, 3 Oct 2023 15:08:00 +0300 Message-Id: <20231003120813.77726-6-sakari.ailus@linux.intel.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231003115237.76828-1-sakari.ailus@linux.intel.com> References: <20231003115237.76828-1-sakari.ailus@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org As the user needs to know what went wrong for S_ROUTING, copy array arguments back to the user. Signed-off-by: Sakari Ailus --- drivers/media/v4l2-core/v4l2-ioctl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c index fb453b7d0c91..6921a72566df 100644 --- a/drivers/media/v4l2-core/v4l2-ioctl.c +++ b/drivers/media/v4l2-core/v4l2-ioctl.c @@ -3419,7 +3419,8 @@ video_usercopy(struct file *file, unsigned int orig_cmd, unsigned long arg, * in case of failure, but it is not defined here as part of the * 'v4l2_ioctls' array, insert an ad-hoc check to address that. */ - if (err < 0 && !always_copy && cmd != VIDIOC_SUBDEV_G_ROUTING) + if (err < 0 && !always_copy && cmd != VIDIOC_SUBDEV_G_ROUTING && + cmd != VIDIOC_SUBDEV_S_ROUTING) goto out; if (has_array_args) {