Received: by 10.223.185.116 with SMTP id b49csp6386302wrg; Wed, 28 Feb 2018 08:33:46 -0800 (PST) X-Google-Smtp-Source: AH8x226STLnx/E/suSV7yT4SXZX5hLjwUP7uzgxjxE2yOPJXIpjgYIas1BEUaNjx3l7xO9ivIaJ3 X-Received: by 10.98.245.18 with SMTP id n18mr17936733pfh.25.1519835626597; Wed, 28 Feb 2018 08:33:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519835626; cv=none; d=google.com; s=arc-20160816; b=Uy5sT4iM4PSChKdxXclSUoybeLFevoKCuj58nczgzd7kF8M25UB6MMXNUJiURu01OJ 4L4+w1z9KE6z6M3MKcEGboDbGk4R9rssX5ly0b9dM/sJZmcWFLCrcLev9gGcXsA++84K /FVxV0vltwSi1H/PxjD1UFzSyl2qHWbsuZpLefR8VAvMzPVLXZrwku8Oh8MIfgM0xziQ zlt0TFNhxgOYtXsib/g1BeaSjg8HZKHgRjODsgxaBlpAmbWjWY+wKk0uKzL5ch4HcsR0 KQOhrPX9vWAmtmpa0QB0Jg32t/ElMa+Z36PGet26q58TEiF4iffVfdXRa/FzDWgmumRp FgQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:subject:message-id:date:cc:to :from:mime-version:content-transfer-encoding:content-disposition :arc-authentication-results; bh=RUAWTWZacs/+H+ITN6uGJ23aZY0HZWYslFUVMDHo0fA=; b=kCJKvKHBQ/CMib64hLg6+z0F+kycOfLqPmAPCvGsRXmeGqQlm7zwy/LvL0WFAYSaU8 yUk9EF+iPf6PqpQviZzhUiKmI+B/IvKkz4aLu98LolYXsHlPuXIZjVGl3FBzqYrC+C95 CDrkbifvY4gH5N4q5FP/KRduspbmMRDKbVmD9IVHumK2f/OAsuMnmOj/bTVBidRFqrfi 8Lfvpp+p69GJaOVWFnUw1GlYyVLXIbx5T7Yd6lDD8sTwOhYplBAjlnls/RxzHTzdFNLB 2b+lMzVe5j6af1MkdDFkcps5zyVES2yGh37Hp6Fo8EbhQafYnZDwotBMxK75e08juimV KnVg== 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 95-v6si1491066plc.612.2018.02.28.08.33.29; Wed, 28 Feb 2018 08:33:46 -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 S1753296AbeB1QOZ (ORCPT + 99 others); Wed, 28 Feb 2018 11:14:25 -0500 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:35104 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753118AbeB1QOT (ORCPT ); Wed, 28 Feb 2018 11:14:19 -0500 Received: from [2a02:8011:400e:2:6f00:88c8:c921:d332] (helo=deadeye) by shadbolt.decadent.org.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1er3Ym-0006Xf-Gy; Wed, 28 Feb 2018 15:22:25 +0000 Received: from ben by deadeye with local (Exim 4.90_1) (envelope-from ) id 1er3Yk-0000JJ-S1; Wed, 28 Feb 2018 15:22:22 +0000 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, "Hans Verkuil" , "Mauro Carvalho Chehab" , "Sakari Ailus" Date: Wed, 28 Feb 2018 15:20:18 +0000 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) Subject: [PATCH 3.16 240/254] media: v4l2-ioctl.c: don't copy back the result for -ENOTTY In-Reply-To: X-SA-Exim-Connect-IP: 2a02:8011:400e:2:6f00:88c8:c921:d332 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.16.55-rc1 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: Ben Hutchings --- drivers/media/v4l2-core/v4l2-ioctl.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c index 16bffd851bf9..e2f71def945a 100644 --- a/drivers/media/v4l2-core/v4l2-ioctl.c +++ b/drivers/media/v4l2-core/v4l2-ioctl.c @@ -2402,8 +2402,11 @@ video_usercopy(struct file *file, unsigned int cmd, unsigned long arg, /* 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);