Received: by 10.223.185.116 with SMTP id b49csp2206458wrg; Thu, 15 Feb 2018 08:06:06 -0800 (PST) X-Google-Smtp-Source: AH8x224g3mf97lIGExzg5wUH84NyQiOLRV7JkqeF/W1w+fxOcHRgcbkvZwtJZI4jtml6DCd54P1o X-Received: by 10.98.67.157 with SMTP id l29mr3093708pfi.214.1518710766236; Thu, 15 Feb 2018 08:06:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518710766; cv=none; d=google.com; s=arc-20160816; b=kG0kdQx4W2xSjI6BUJiSb1VtViD/W1seifjgSvi3DmqAhC4tgzy5jk4e8owgprf6Up faY1EKMll+HwOgV4wKrNWllJbuQoucjCcstFEu01DX+uBwWSHJNOsNhm4YneYlUkYohX NEEaOyrSJ6Mm9uC35o2VQNhvmUGOEfBt5cisc6XtpidjeECEKihbX8rxfCyxKQDvqk6g K07fY19oCydsFPYOwRSv2BRLQWCT336E9Ly95cvpaDUd1c2JOx1nM2Co94w7ayl+wXTy 1Q+RlT/b00HTkGANaOfjChIp/mPol4XKFy9zW9TYYYhJjuqWunxWRtjNSXdbMtheklGQ DVIw== 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=fd3tbxx322UnKoJ8Q3wUipw5sMbt6vi0pw0fQyawOwo=; b=XjJ77s/sYZOTcxo2MLAysXM6MidF0mca/KDAoOELxBNXY9FXjT3g/vcfgVxky2k+O/ uMNkafFzuThUxtLJOhE/o/xvhKB3XGt4EXuiwNi/GA/+Z4ERgwcKclvLiLOhcD/MBEa+ o6/YjEOl4V/7hZAPQIK1HMB4YqAjN2CZiCRJ1sJgJwrSqdKHpYF8e64fTFZDxv40t+54 sAMMQG5eNKaQzIdfNi0oh6XPUi+bhYYKYYycTLJMue6bnu+eujAIxPfl2BDY2/g01rQM ZGDOURi75+9RXSJk4fimYcPb2y0QHR6ya96DjrD+efngmI89NGUbczBPvb9yQcNIElFe 8TJw== 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 y9si1402696pgv.347.2018.02.15.08.05.51; Thu, 15 Feb 2018 08:06:06 -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 S1425513AbeBOQDW (ORCPT + 99 others); Thu, 15 Feb 2018 11:03:22 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:35554 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1424672AbeBOPq0 (ORCPT ); Thu, 15 Feb 2018 10:46:26 -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 EC74CC26; Thu, 15 Feb 2018 15:46:25 +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 124/202] media: v4l2-compat-ioctl32.c: dont copy back the result for certain errors Date: Thu, 15 Feb 2018 16:17:04 +0100 Message-Id: <20180215151719.731640760@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 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. */