Received: by 10.223.185.116 with SMTP id b49csp6375205wrg; Wed, 28 Feb 2018 08:23:00 -0800 (PST) X-Google-Smtp-Source: AG47ELsLyiFdVIzzuydu2wVqBo8G1s4r6GzWR7F+gnNjSbDwKIEYzE4WhPDit8UXllx8FGYXGgTn X-Received: by 10.98.69.196 with SMTP id n65mr5747891pfi.29.1519834980051; Wed, 28 Feb 2018 08:23:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519834980; cv=none; d=google.com; s=arc-20160816; b=DBHP9iAshpM2vYQL15VNkcIsoRsAVhMRYafmbkscKRMSj+0g4dEHwIUwRoxw6dryA1 EMJRu+kEkQ0/+UJeoLSvxHq1x63EHNFoJAIaTXDBoGALQNQIXK5EenuOeIsqPipqv/cQ OF08LY1BsJnYc9GS+isoW0lAmPreGdcqxLMITX3L6dMoSfD8ZRY2K1WJkOw/bZv3Gmcm uVLHI+1XN6UEIckEkasGUlqVPFoO89YWkz+FxUq01zIY8Dmsw8uuJOq+caHyqc3Olcjw nLTvC2iaTcb/EETt3+EpIPIy7/rGQi+TNyn+AgQ+C4dcWxqeuYlf0OluvWmF4QdMgOC2 LWkw== 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=YCEMt5XwXI46u82hfhVYmaW4Ngir1Yc7gN7Z8VAD8vg=; b=Bi3ptdjIESYg2MQuQCj3RshKf0fMh4jJmhmhevZDljIl/GcqIayKdAQ8kXzMwSgqO6 t2kFq4br+vG0hgFiCDy+fZ/M+NgPqBAkoU7vQF+Sz0yJ7d93DbOerCN5MsAxszxXoOVT DYVNPt3EoKq2EJY/SiL9J+0F9/3LxkLcH8aBodUnBl7x68Eus3SBaPhJ8rJN5wNI2BKZ ysVWu7l+crXjFxkmIzYRf4e+lopEiaQeF+NzAbP8o4QwyqnO3fzR68vOLdxyBgZq+aQK 4G2dtq+1m1Faa0YPoY3t3p98UIndd7qTIpAYzw8ON60KwfD5TNMOIUxJTskP7p5uMxG3 9Gjg== 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 i2si1093429pgf.145.2018.02.28.08.22.44; Wed, 28 Feb 2018 08:23:00 -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 S935025AbeB1QUR (ORCPT + 99 others); Wed, 28 Feb 2018 11:20:17 -0500 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:35324 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932479AbeB1QUN (ORCPT ); Wed, 28 Feb 2018 11:20:13 -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-0006Xc-Ev; Wed, 28 Feb 2018 15:22:25 +0000 Received: from ben by deadeye with local (Exim 4.90_1) (envelope-from ) id 1er3Yl-0000KC-7F; Wed, 28 Feb 2018 15:22:23 +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 251/254] media: v4l2-compat-ioctl32.c: don't copy back the result for certain errors 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 d83a8243aaefe62ace433e4384a4f077bed86acb upstream. Some ioctls need to copy back the result even if the ioctl returned an error. However, don't do this for the error code -ENOTTY. It makes no sense in that cases. 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-compat-ioctl32.c | 3 +++ 1 file changed, 3 insertions(+) --- a/drivers/media/v4l2-core/v4l2-compat-ioctl32.c +++ b/drivers/media/v4l2-core/v4l2-compat-ioctl32.c @@ -933,6 +933,9 @@ static long do_video_ioctl(struct file * set_fs(old_fs); } + if (err == -ENOTTY) + return err; + /* Special case: even after an error we need to put the results back for these ioctls since the error_idx will contain information on which control failed. */