Received: by 2002:a05:6602:2086:0:0:0:0 with SMTP id a6csp4383398ioa; Wed, 27 Apr 2022 02:34:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy0pGyuC5Cy3CgfDlIBSk5G/Pb5m6+yDAxUu+kGmE4CexwTAYv65AYjTYI9WakrlP+Lb5HM X-Received: by 2002:a05:6a02:206:b0:399:3c9:f465 with SMTP id bh6-20020a056a02020600b0039903c9f465mr23590785pgb.388.1651052074245; Wed, 27 Apr 2022 02:34:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651052074; cv=none; d=google.com; s=arc-20160816; b=g4FqAXNJbRaITiPruArfgOOgQ6tszWInG1rhO38lZfAK/6xGEa6VTiLs9pFMpoeG3/ rMvRr5sJSjANS5L79xupoUbK5KzoFUVjQ/G68emRs1bKGfn8glGSVshZo6D2W/TSlTFU 2UFXkcXdvNhi57cD+ciTP0Bk/q9ofHijY5VzqpUKcaTOe3K2OHIz4e+s4KuZWojpXC3C DtWRNxDFjBf+EJe0iSp0uChtLG6odkTgoCQY+9hN+xegleoXxmNgMHphnRFfQfHNH6aO p/29ujo4pFNMNWHiQRXJ2c1Puq+uJH/cbftcldT3xhi5hOa+146ytV+wcpPTZ0pwMYr8 kkug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=8WV9CNwFNYgJrc0l9d18fSdUIwRsafwNSc3A7ZPxsV4=; b=A0IrC89Dhl3vqGWD1gAPhgvFbRGuIw+96J4ue6AoXUhs2VeEkNjo8WIBrQG1tlLv0o B7DWg6CnMAMR5wTM12nnLcmYOLx0tmaBPbJWlClQTuk0K60wBVgNArySgyO3JDw5hrr8 UmfzAEqh+4AJjJ+1vx3ZPIUw4ifGPHrx3xNV6CjLJkPKsqJraj5dZuDAvDccigSIfWyd i2vSvBB4cfg4VDKSJ8zeFbNWwJ6A61G+YlCis59WZ+JAhQ4oXJT5h3ZDHbvBuQ8YHkvp FytExf5pcux78yw36kfTfYAC4iFcAmaZkRe7MtjTqp5wtQ02jTpgLyaNPLpz6oL/pL44 6Iqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Rvvgv8eV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id b4-20020a170903228400b0015a79b65a35si1256065plh.198.2022.04.27.02.34.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Apr 2022 02:34:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Rvvgv8eV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 9C1B6263CB2; Wed, 27 Apr 2022 02:14:13 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347317AbiDZJKd (ORCPT + 99 others); Tue, 26 Apr 2022 05:10:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55532 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346751AbiDZIuU (ORCPT ); Tue, 26 Apr 2022 04:50:20 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1DBD9156E19; Tue, 26 Apr 2022 01:38:52 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 7EE5460A29; Tue, 26 Apr 2022 08:38:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8A1D6C385A0; Tue, 26 Apr 2022 08:38:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650962330; bh=E3YA0VDkKR9MVzQZUwZQbMCrslKr57iOaOn7doSJ9vs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Rvvgv8eVzjyhHL/PssLzMXTlloXInxu7MSactj3fySNoKYcC9IS8LNevLzDq4FMX0 j+TgEwfseiCghqMnLhzbNp0jFMMQK+sQsw2q1dve4v/36YghvShd3pI+k4x0Rq7n9K 0RYfllRJSD8ZsIjdK+ZkfPm29w1Xdzevn/NDDeRo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hongbin Wang , "David S. Miller" , Sasha Levin Subject: [PATCH 5.15 060/124] vxlan: fix error return code in vxlan_fdb_append Date: Tue, 26 Apr 2022 10:21:01 +0200 Message-Id: <20220426081749.007506940@linuxfoundation.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220426081747.286685339@linuxfoundation.org> References: <20220426081747.286685339@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Hongbin Wang [ Upstream commit 7cea5560bf656b84f9ed01c0cc829d4eecd0640b ] When kmalloc and dst_cache_init failed, should return ENOMEM rather than ENOBUFS. Signed-off-by: Hongbin Wang Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/vxlan.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c index 141635a35c28..129e270e9a7c 100644 --- a/drivers/net/vxlan.c +++ b/drivers/net/vxlan.c @@ -711,11 +711,11 @@ static int vxlan_fdb_append(struct vxlan_fdb *f, rd = kmalloc(sizeof(*rd), GFP_ATOMIC); if (rd == NULL) - return -ENOBUFS; + return -ENOMEM; if (dst_cache_init(&rd->dst_cache, GFP_ATOMIC)) { kfree(rd); - return -ENOBUFS; + return -ENOMEM; } rd->remote_ip = *ip; -- 2.35.1