Received: by 10.223.185.116 with SMTP id b49csp687151wrg; Fri, 16 Feb 2018 05:41:34 -0800 (PST) X-Google-Smtp-Source: AH8x226reYskMXld0mV1o7PLtO4Y/kdP/I77D8q3bIVeiYDclGEwgpbK29Fqwm2wak7YJLp9ftCZ X-Received: by 2002:a17:902:5854:: with SMTP id f20-v6mr5934374plj.374.1518788494590; Fri, 16 Feb 2018 05:41:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518788494; cv=none; d=google.com; s=arc-20160816; b=HFR8fmRqj2a+G0AuyYs6mpVuRpPnUZGc6BjebMFtF+enB8XNjrsYZf9N6lz8CE6M09 maa2tnl7jJrY60SBaWjhJYdsdmBlqcRQmZ1hKCJ+FIyPT/mJOFIe/rq4upQZUouJ0YZ8 aPII3dWQurjmVBsR73JiTm6Vtbb2KwoDBAV5laZrirD0TBy0hxiEGTpvNh4nF6blh2jr zI2mspqUEhKcUZmul/FZX08AKKauzRQSvIorUFPOTOFTylpCJhPyfZ4fQhCMTyIq1Ybg 3sBjCcPHjpUFEYngc4clPkLO+4VlkZqySLkmb3Jio8+u2s2WJGaEbY/Fp3hPht0M3oBI tuvQ== 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=oHjbdyTEo3NZLgyof3QIkQYTjavYHPwcdA7MnHvbmMs=; b=iE3ehaOZCfgEhMk8Qe7KIb4C8fvxTqB4SckWXt/o8JzZdMMZM2eesfIogY8WR0vRYf dQ6mf5EAOlkeg+6HTbVKx4sZmYJx4mQxj07in0TSAj1MLLT4fROCZrnmGGGEuCJsr4dc SAzhRjMUfQaCO368TC7LmtalolKWymZoTu7g15JiHsLzZEuNkRCcOnlUg+WByFLxf5eU 4vt3UQ/lKbSPj8venA290sDlyJHTQTtdz6wHLj3qJzVbQvuo3+d2qG5rBM++nlIQO34b kLCWZJ5+758VLmUFiAhVwbZscURh0AZ6odVg4HHBJAbxvK4QLIRobPLQnfc0RGoIITb/ UOuQ== 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 k6si1307869pgo.818.2018.02.16.05.41.19; Fri, 16 Feb 2018 05:41:34 -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 S1946322AbeBOSgv (ORCPT + 99 others); Thu, 15 Feb 2018 13:36:51 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:51814 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1033918AbeBOPYM (ORCPT ); Thu, 15 Feb 2018 10:24:12 -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 EB8A5E34; Thu, 15 Feb 2018 15:24:11 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Greg Kroah-Hartman , Hans Verkuil , Sakari Ailus , Mauro Carvalho Chehab Subject: [PATCH 4.4 083/108] media: v4l2-compat-ioctl32.c: dont copy back the result for certain errors Date: Thu, 15 Feb 2018 16:17:20 +0100 Message-Id: <20180215151233.908681596@linuxfoundation.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180215151222.267507937@linuxfoundation.org> References: <20180215151222.267507937@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.4-stable 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: Greg Kroah-Hartman --- 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 @@ -956,6 +956,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. */