Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1974970imm; Thu, 24 May 2018 03:53:11 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrEOsH3ZXjMp36kxsiBCs0DdxcRhFXenpHZ7718Vl4TLnifWGKAjBNVJkIANkTKDBJ2N4iY X-Received: by 2002:a17:902:206:: with SMTP id 6-v6mr6770399plc.294.1527159191520; Thu, 24 May 2018 03:53:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527159191; cv=none; d=google.com; s=arc-20160816; b=kD/q/Fdlg9eR9fmWQGtGkCyTQZ2kbrh7XO6W3i/q7TdmrYWhu3ZvFB0WOXG1D3wT3w XcZFw4vOyUSmdhQWaIcMu1Zj4Z+hJDbjdFFrK25x/oKiwM2sAIpisNtz4+pyIAxaJPwV oc2HLgMQSmxFnAAoivWSvoYgSjr/rx8akC4Vll9VCuaSolXFCI+CN6835ictB0n45XsK 5N2O49HjYQmRNrnxS7beIij0mZQJzhZSRUjfcK7b6ZwWH0O6PvwFlOlwFlPqkoVaz1yi cHAsd2BhbyoPgZ4p61+XXE2zlj8gvTcbTB2POo7+ZGbRF38Med4LZhgTO4WCxNxdtClT SoBw== 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:dkim-signature :arc-authentication-results; bh=stvuKhHHsC5rbvMq0mQjWrogcaN2EniNCE4BffmbGZE=; b=CE1mAXDsYmCo0tXPYRoekOwdDBbPi8Fqu3s/EnpPK5apIg9G8/ZIyqdGHvVfwMFBlp hrNt2bwyVvK4P+c9uz66gZ0aBF7eA+zJ4c4TMml9cgVsecab6HMVTwA3SMmY07kGOLvO cAlJos+lFt+iLwUjj8qt8Uz5iue4MTR6fsH6z9sR96mPC/0FGL7YyEq7QRp/uSpJQYDp WhohrZP45imgVo5Y6oFeH5UXkiJhyuRlG8TYDP+aYuGiXh9Rurrcr7keA8IDacGw0B+L 1E5RYDP+OG9WPnQJtdFR6/rFYFDbU2Fmgwg2CZfdjLwVHl1JLopSCBSWH3OOHS4YL+wW F+bA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=weGgg7a2; 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 z3-v6si16520667pgp.132.2018.05.24.03.52.56; Thu, 24 May 2018 03:53:11 -0700 (PDT) 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; dkim=pass header.i=@kernel.org header.s=default header.b=weGgg7a2; 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 S1032501AbeEXKwK (ORCPT + 99 others); Thu, 24 May 2018 06:52:10 -0400 Received: from mail.kernel.org ([198.145.29.99]:37272 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030426AbeEXJ5Y (ORCPT ); Thu, 24 May 2018 05:57:24 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A33AC20891; Thu, 24 May 2018 09:57:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527155844; bh=liQmSb98MTi2BZEDVtnzSqwSrXqayZgS/AWmp4Lcce4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=weGgg7a2QjebzxjUgEmXIsJBk9c0MsJklfuyOjsDi5MEGyPl8LWV9aVXXvfnvB0WX oW9Kqli4rtU74atdBkzCqPkpgCwQ1+bLDBKjdFRRZsquRlta+omJ8HA43NNg8ZB8sQ I/t9G2xlmLozjikKZhZ6mifOWTKKAeqej2wC0sd4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mauro Carvalho Chehab , Sasha Levin Subject: [PATCH 4.14 137/165] media: dmxdev: fix error code for invalid ioctls Date: Thu, 24 May 2018 11:39:03 +0200 Message-Id: <20180524093627.619143722@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180524093621.979359379@linuxfoundation.org> References: <20180524093621.979359379@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review 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: Mauro Carvalho Chehab [ Upstream commit a145f64c6107d3aa5a7cec9f8977d04ac2a896c9 ] Returning -EINVAL when an ioctl is not implemented is a very bad idea, as it is hard to distinguish from other error contitions that an ioctl could lead. Replace it by its right error code: -ENOTTY. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/media/dvb-core/dmxdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/media/dvb-core/dmxdev.c +++ b/drivers/media/dvb-core/dmxdev.c @@ -1055,7 +1055,7 @@ static int dvb_demux_do_ioctl(struct fil break; default: - ret = -EINVAL; + ret = -ENOTTY; break; } mutex_unlock(&dmxdev->mutex);