Received: by 10.223.185.116 with SMTP id b49csp167167wrg; Thu, 15 Feb 2018 19:04:55 -0800 (PST) X-Google-Smtp-Source: AH8x225Xa4v6l9qpN6I4B++swHduEoWmCZPTfkkpd9s1oQA0MRUm128xZki5BOhBpNdFfCqch4G0 X-Received: by 10.99.102.193 with SMTP id a184mr3957555pgc.141.1518750295580; Thu, 15 Feb 2018 19:04:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518750295; cv=none; d=google.com; s=arc-20160816; b=I6kM3aEfF2OvT4xi/LmqSwyyZ2G/e8W9IJiLCoEEw4h2cCkE+hL2tJy4DNuiD3yNYM XQRdA4N05kYsRD462n6oat9TylZ/yhWQRacXqAZBrDtD3dT2AJ7CDwbzRI1b7KHr+wFE 75ShF+YO+q3PrkW2G6qbJXp8fKJ7EN+74cyexZNSoeUQLZ3OYsCI+avnGFRWQdNBRlKm +GBXcP1eNoVwX8dfwLefnTJIW0o8+UD0KxzzDTm7teBqxoO2HgsvlS8cv4MIDEDOXwaw +dRoLUuYzZXJ5G7AYwwZ8ZVaLW9nMdRbStGeJ4BvEk4WtN+GwuKGt+X+BYYO/2jfJXDe 7HIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=mLuk1jLHYk9R6RDG7CJzUgtuA2Vy6VNVwgMrYPc0BoA=; b=ijqHOUJ0iCr26EOTb9BIhucmGlgp5Q94W2C89LF54uWEElOBkiTmIPedCz0/G0pS4d gIOioOJFy98V2XHK9f8WMmOGpuWaoScWdiJN1FE8ptHRDRub0PJZYsc3rF908IlQi2NC mIG95ncMCz+2+JTUa4e27/nIKhGnbfumaIkAC6WFNWiI6GZjB5f/J6mdiKWhE6AKBYY0 g+z33JTJwZCFPWRVL99UlYvPhgw4loFYHuO6gN1mvw0dRLmoI7g3MVHBWx30syyAJPqA xKp5RiKfTqHXVmv8w+z0Xi82XEKncOw3Svd2qvqG/P0aCs1QxCfdnajr/cz678UC8PKd HE3w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v17si3354175pfa.47.2018.02.15.19.04.41; Thu, 15 Feb 2018 19:04:55 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1165382AbeBOPn5 (ORCPT + 99 others); Thu, 15 Feb 2018 10:43:57 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:34130 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1165346AbeBOPny (ORCPT ); Thu, 15 Feb 2018 10:43:54 -0500 Received: from localhost (LFbn-1-12258-90.w90-92.abo.wanadoo.fr [90.92.71.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 4E1781188; Thu, 15 Feb 2018 15:43:53 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hans Verkuil , Sakari Ailus , Mauro Carvalho Chehab Subject: [PATCH 4.15 115/202] media: v4l2-ioctl.c: dont copy back the result for -ENOTTY Date: Thu, 15 Feb 2018 16:16:55 +0100 Message-Id: <20180215151719.260712503@linuxfoundation.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180215151712.768794354@linuxfoundation.org> References: <20180215151712.768794354@linuxfoundation.org> User-Agent: quilt/0.65 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Hans Verkuil commit 181a4a2d5a0a7b43cab08a70710d727e7764ccdd upstream. If the ioctl returned -ENOTTY, then don't bother copying back the result as there is no point. Signed-off-by: Hans Verkuil Acked-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Greg Kroah-Hartman --- drivers/media/v4l2-core/v4l2-ioctl.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) --- a/drivers/media/v4l2-core/v4l2-ioctl.c +++ b/drivers/media/v4l2-core/v4l2-ioctl.c @@ -2895,8 +2895,11 @@ video_usercopy(struct file *file, unsign /* Handles IOCTL */ err = func(file, cmd, parg); - if (err == -ENOIOCTLCMD) + if (err == -ENOTTY || err == -ENOIOCTLCMD) { err = -ENOTTY; + goto out; + } + if (err == 0) { if (cmd == VIDIOC_DQBUF) trace_v4l2_dqbuf(video_devdata(file)->minor, parg);