Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp2017880imm; Thu, 24 May 2018 04:35:45 -0700 (PDT) X-Google-Smtp-Source: AB8JxZphdQTafpFPXF8O3RorCSq+NKL7DeT6sw9Lhe2Mgt3bwXEKxsFhPGp7V19SPKT2gLTrS6qn X-Received: by 2002:a63:350d:: with SMTP id c13-v6mr5701574pga.426.1527161745598; Thu, 24 May 2018 04:35:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527161745; cv=none; d=google.com; s=arc-20160816; b=I18mTo0C9A1RFEQC6funHEIeab3oV6vEkNfGkYNbR51eSDK/3zGaC1fSJucEbWlipb X2TnoRA7LiDFOUT/jUdvelYvWm7yZ9GbZd5hzkiBUPbn2fYBLEYDomWnDVeR3HT3cO3Q Z6FyrdYZp5sxSqZAYwxLVaTJ4+nVb5s8h6TJgJUfkhivtuTrmW3QaU2xFoCxDy/rgojW VibbhS87+Oe/SktHh5En8aI0OuRLwk7yiu1NxQZ2/Ld6qiWsPkjTkK0CuzHBwCrAblqB WY2m+P/jTVgJJUZTF9ufkmcdAhmXUqXTMmxCOJfb/rPap9+ZtRPkBxQkKjIBm+J9EFzX swBw== 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=TZdnj/OvxHmmXHN97kJZ5+ofVT0Bwu+3iPbl6W3Er6A=; b=rZFStBuh2hQT4/aodKv/7JYL32EqQrvdwTIhpMss18jsoRr+jhIAws4oBKR1/ATPiN 0BA4zoCgPtF63AK8hPQBv/geXx8JDb/5ARSy+6uCpndczI38Fmj8NV9nBNqytPg7m9Jx ZmxC8EXjV9pr2W5zZZddeuCxKWZ+tD0UkD4p884G6jw/68viCPVCk2GaAstpwtBfLanh 1cYn5AopJQKSlnFESE87PgsBi3bpbP/DyfiQLTBYTHYDAO7cIJPleoWISldRGHNr5QpW moCLw9x1nN4Vf2qQsyatfatpPhEIW9LLlin69WGkMeB4a8j4OfCLzWSBYXCRBMNyZ0CW cCQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=CO3RgCaq; 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 t6-v6si16468177pgp.594.2018.05.24.04.35.30; Thu, 24 May 2018 04:35:45 -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=CO3RgCaq; 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 S969041AbeEXLd4 (ORCPT + 99 others); Thu, 24 May 2018 07:33:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:41518 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S967574AbeEXJu1 (ORCPT ); Thu, 24 May 2018 05:50:27 -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 120BE20870; Thu, 24 May 2018 09:50:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527155426; bh=FmW6D66PIXyb0CUsPcpLWw2+ZAGwJ/rC9NteTGI9FHw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CO3RgCaq++/1pN1GyV+U4PDBqgyAE/AjnwVnB6eCe5LKzBESSQV3fJMAhOs5byRm+ tsMyJO4VXi8Xp1A+pLb8IaW80wC5Gwo/kzq7GI4E6cJ3jVcNAEOLl+Bo+sJXzJjvnn L6lyX7N/JbmHinbFPFNyz9AYebu004f9Lkw6Qwb8= 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.9 81/96] media: dmxdev: fix error code for invalid ioctls Date: Thu, 24 May 2018 11:39:04 +0200 Message-Id: <20180524093610.026366349@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180524093605.602125311@linuxfoundation.org> References: <20180524093605.602125311@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.9-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 @@ -1071,7 +1071,7 @@ static int dvb_demux_do_ioctl(struct fil break; default: - ret = -EINVAL; + ret = -ENOTTY; break; } mutex_unlock(&dmxdev->mutex);