Received: by 10.223.185.116 with SMTP id b49csp2284253wrg; Thu, 15 Feb 2018 09:14:53 -0800 (PST) X-Google-Smtp-Source: AH8x225q9O7ACwb6Lx4qrrVCpsP74fQhpGQQtR+c4YXZk2Htz67t3KSdNm3yDmIoo4upqSE2cf/V X-Received: by 10.99.100.196 with SMTP id y187mr2791720pgb.362.1518714893774; Thu, 15 Feb 2018 09:14:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518714893; cv=none; d=google.com; s=arc-20160816; b=BzVxiezbXANyvcNsL8Ct9HjpShPZxmtAHHxbrHLzuTQD2mIGdxOINhDuQjGI1mxOoT dw5dmYwkp/fJAzVjqos7CjWgAQmOVo2WjDlxhVvfViAISNmFYT4Y6dA4Fudso4CcskxX +M+ilzWCpbuc1VlxC/D8utEYmRhhyAmVv4BqBMZI33/QCSyb4byCJH10obKu3/Pg4rou YjNGy20HDu6/km7LGmh/8OwDxRxUuf/BR91LaTDjl8SP23lfbrIVEX9R+1mHh8SHG4ue j0p2Vue2JgqeOBjdon6QMSyP0LKHp2fKX5ZM8OsrVHE6B8mAohyhHl2K1QReI/P/hW55 dUCw== 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=6eynA7+GW07pPge6WmETiOxLqGXzmwJjMw6Ycd/naFU=; b=qDnsGNuCseU0JBd+ORy+xEP0QF21c471p1n/J6t21eMIkt/XMaj1bcRBR5q+qw0me0 eMAhiUy9+49Vxy4e3J4bpT79gM2SHR1bgfg+rpLBSESKAspxDH557lAgjiubDXNX/+Q6 vXhvivWS/D4dFtC/k8kAN32HFXR0k7OyvkhDp4ZlPnrGTf2pod2Z/ZUTKuv9+YZEP3KB OkTWqG6IDBU/Bk87jHsEzlWqTtAHuEUDCDZAVX6fPNoh+F4JQ+aswG3Dt6gFEhhuVK1Z j9UgEWkjpxZZoF043jfvq16CQR7dynmy8gP1hL+xhgsjTFyueJnOr32IQ7VLqHq47TVv F+Nw== 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 l12si1314817pgr.790.2018.02.15.09.14.37; Thu, 15 Feb 2018 09:14:53 -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 S1423039AbeBOPhH (ORCPT + 99 others); Thu, 15 Feb 2018 10:37:07 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:58846 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1423003AbeBOPhF (ORCPT ); Thu, 15 Feb 2018 10:37:05 -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 7EC2FEAF; Thu, 15 Feb 2018 15:37:04 +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.14 130/195] media: v4l2-compat-ioctl32.c: dont copy back the result for certain errors Date: Thu, 15 Feb 2018 16:17:01 +0100 Message-Id: <20180215151712.249453715@linuxfoundation.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180215151705.738773577@linuxfoundation.org> References: <20180215151705.738773577@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.14-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 @@ -968,6 +968,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. */