From mboxrd@z Thu Jan 1 00:00:00 1970 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=-18.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable 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 2C99BC48BE6 for ; Wed, 16 Jun 2021 15:35:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 174DF613D3 for ; Wed, 16 Jun 2021 15:35:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234351AbhFPPhX (ORCPT ); Wed, 16 Jun 2021 11:37:23 -0400 Received: from mail.kernel.org ([198.145.29.99]:50166 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234799AbhFPPgy (ORCPT ); Wed, 16 Jun 2021 11:36:54 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 62C7761351; Wed, 16 Jun 2021 15:34:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1623857688; bh=tMG4lMg4GzPU9jOWI6iZ4MqnHaiekNjdVNQFOZWfJ1A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1Ot9jPuJIyGtYa0nAprxNS6sEq/zeUne1mzqtZRdZTys5xcUZI/vGUDwASKVVfU5r 6XjkWGhYQHUwXRy842BMzV+WcbRLo76SffI3PUYMTjkfM+PZZEoJKRJN2xQtNYVl2S WGMkRmOFCGju9USP9prUSDXpdSnr1ytStSsV1hm8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Zheng Yongjun , "David S. Miller" , Sasha Levin Subject: [PATCH 5.4 26/28] net/x25: Return the correct errno code Date: Wed, 16 Jun 2021 17:33:37 +0200 Message-Id: <20210616152834.978856529@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210616152834.149064097@linuxfoundation.org> References: <20210616152834.149064097@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Zheng Yongjun [ Upstream commit d7736958668c4facc15f421e622ffd718f5be80a ] When kalloc or kmemdup failed, should return ENOMEM rather than ENOBUF. Signed-off-by: Zheng Yongjun Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- net/x25/af_x25.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/x25/af_x25.c b/net/x25/af_x25.c index cb1f5016c433..d8d603aa4887 100644 --- a/net/x25/af_x25.c +++ b/net/x25/af_x25.c @@ -546,7 +546,7 @@ static int x25_create(struct net *net, struct socket *sock, int protocol, if (protocol) goto out; - rc = -ENOBUFS; + rc = -ENOMEM; if ((sk = x25_alloc_socket(net, kern)) == NULL) goto out; -- 2.30.2