From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752492AbdBMRD3 (ORCPT ); Mon, 13 Feb 2017 12:03:29 -0500 Received: from smtp02.citrix.com ([66.165.176.63]:26138 "EHLO SMTP02.CITRIX.COM" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751611AbdBMRD2 (ORCPT ); Mon, 13 Feb 2017 12:03:28 -0500 X-IronPort-AV: E=Sophos;i="5.35,156,1484006400"; d="scan'208";a="415505297" From: Paul Durrant To: , CC: Paul Durrant , Boris Ostrovsky , Juergen Gross Subject: [PATCH v3 1/3] xen/privcmd: return -ENOTTY for unimplemented IOCTLs Date: Mon, 13 Feb 2017 17:03:22 +0000 Message-ID: <1487005404-3183-2-git-send-email-paul.durrant@citrix.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1487005404-3183-1-git-send-email-paul.durrant@citrix.com> References: <1487005404-3183-1-git-send-email-paul.durrant@citrix.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The code sets the default return code to -ENOSYS but then overrides this to -EINVAL in the switch() statement's default case, which is clearly silly. This patch removes the override and sets the default return code to -ENOTTY, which is the conventional return for an unimplemented ioctl. Signed-off-by: Paul Durrant --- Cc: Boris Ostrovsky Cc: Juergen Gross v2: - Use -ENOTTY rather than -ENOSYS --- drivers/xen/privcmd.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/xen/privcmd.c b/drivers/xen/privcmd.c index 6e3306f..5e5c7ae 100644 --- a/drivers/xen/privcmd.c +++ b/drivers/xen/privcmd.c @@ -551,7 +551,7 @@ static long privcmd_ioctl_mmap_batch(void __user *udata, int version) static long privcmd_ioctl(struct file *file, unsigned int cmd, unsigned long data) { - int ret = -ENOSYS; + int ret = -ENOTTY; void __user *udata = (void __user *) data; switch (cmd) { @@ -572,7 +572,6 @@ static long privcmd_ioctl(struct file *file, break; default: - ret = -EINVAL; break; } -- 2.1.4