From patchwork Tue Oct 27 09:09:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin King X-Patchwork-Id: 11859699 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 16D17C4363A for ; Tue, 27 Oct 2020 09:09:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D9DB920747 for ; Tue, 27 Oct 2020 09:09:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2895397AbgJ0JJu (ORCPT ); Tue, 27 Oct 2020 05:09:50 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:51199 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2509681AbgJ0JJr (ORCPT ); Tue, 27 Oct 2020 05:09:47 -0400 Received: from 1.general.cking.uk.vpn ([10.172.193.212] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1kXKz9-0007nL-13; Tue, 27 Oct 2020 09:09:43 +0000 From: Colin King To: "David S . Miller" , Jakub Kicinski , Stefano Garzarella , netdev@vger.kernel.org Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] vsock: fix the error return when an invalid ioctl command is used Date: Tue, 27 Oct 2020 09:09:42 +0000 Message-Id: <20201027090942.14916-3-colin.king@canonical.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20201027090942.14916-1-colin.king@canonical.com> References: <20201027090942.14916-1-colin.king@canonical.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Colin Ian King Currently when an invalid ioctl command is used the error return is -EINVAL. Fix this by returning the correct error -ENOIOCTLCMD. Signed-off-by: Colin Ian King Reviewed-by: Stefano Garzarella --- net/vmw_vsock/af_vsock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/vmw_vsock/af_vsock.c b/net/vmw_vsock/af_vsock.c index 865331b809e4..597c86413089 100644 --- a/net/vmw_vsock/af_vsock.c +++ b/net/vmw_vsock/af_vsock.c @@ -2072,7 +2072,7 @@ static long vsock_dev_do_ioctl(struct file *filp, break; default: - retval = -EINVAL; + retval = -ENOIOCTLCMD; } return retval;