Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3283874ybb; Tue, 31 Mar 2020 02:04:19 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsZ+FmFS9xK/+soRz9x6V4yoXcY+tZtvxZ7yy+DWcK/JCOCwspKHj0vHrCPeLyiBKxpdnty X-Received: by 2002:a05:6830:101a:: with SMTP id a26mr9792600otp.173.1585645459443; Tue, 31 Mar 2020 02:04:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585645459; cv=none; d=google.com; s=arc-20160816; b=r5HgKeUiAnNeMxJmcngbTDgnrv8+etO8xQv35xT6TyAJgKacBd/nosqlP5rl1sAOK8 t6EwkFpFJuiAPCJdT7bbJ360GDnaAqe2/IgkyX536PgpIsGhLX4eCSRwhLsxDQ+uJljM aiv7RyIgvjSynNHL+5JBSNk8wFqV8EWPywD+UImHDZTo1t8CUsLlVkcAJYHRgIZCa7SI JJFWfrPD1/H5gBeVNOBgKaHjyNTtHNo5agyisMzGYsI/+EDWvtsxvfBspLgrvluVfTwK P0IK6WbETCr57A7LugDla1t9GQ5KY7wQ9KuVianM06GiOnjGCzRedr0rahrik5pejvxv WwAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ZPVYfgLPO1K+N7HkQsKM8BRZZjE4dxshO3UdJH+QX3c=; b=zfV32eShjHJ5mlXpq+dwNe6p51w8nM+ina7NIzGr29i4KBVt7/jbaRXLRxW0VECXG/ uuH52v3mf8vOl03TVkw44sWYg4nwmUghETS6A+wGLipZtlOzskrxG5DIG8u79AvL8zBk li4QklN93FkAoGWumg74lfCxws+IBhcHjbPgnU9dK6tVTeSOclL5FZEAZQ9Xf9H8AtzW Sl9j8QykbMLxq5vZsmRFrD5315hxOmO5PvsTmHk0O5k2jWvIaOhfHAl0SExL7sSKudN8 DLQyfY6OTKnVEr2HuuI/fjdNc9KJImGJAx7rlzVdYaCFFW8muUbUM9uFmRxqgtLo6wAJ rsjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=FuSXUCQs; 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 h81si6883836oif.20.2020.03.31.02.04.07; Tue, 31 Mar 2020 02:04:19 -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=FuSXUCQs; 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 S1730801AbgCaJDM (ORCPT + 99 others); Tue, 31 Mar 2020 05:03:12 -0400 Received: from mail.kernel.org ([198.145.29.99]:42866 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730161AbgCaJDL (ORCPT ); Tue, 31 Mar 2020 05:03:11 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 253D22145D; Tue, 31 Mar 2020 09:03:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1585645390; bh=N+owriBuSW8TD8SbqXaAB46DfoDo5110Pd7r+uwbDb8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FuSXUCQsyWFQcssTbgHyOzaVGkNw5MWJ+nMXwKod7w7K1Y/F1RjUJcV5dRxsjZW/e 8EDq8FB6huIAEj+xoXMDrFeOzd+En12T/sLVyuddPhnyEnYkc/G8gdWz4pLolCXC/i wMZvswiDDd67sFSeZKGEuDt0VepYRWh8MwieoHkI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Taehee Yoo , "David S. Miller" Subject: [PATCH 5.5 039/170] vxlan: check return value of gro_cells_init() Date: Tue, 31 Mar 2020 10:57:33 +0200 Message-Id: <20200331085428.174267737@linuxfoundation.org> X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200331085423.990189598@linuxfoundation.org> References: <20200331085423.990189598@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Taehee Yoo [ Upstream commit 384d91c267e621e0926062cfb3f20cb72dc16928 ] gro_cells_init() returns error if memory allocation is failed. But the vxlan module doesn't check the return value of gro_cells_init(). Fixes: 58ce31cca1ff ("vxlan: GRO support at tunnel layer")` Signed-off-by: Taehee Yoo Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/vxlan.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) --- a/drivers/net/vxlan.c +++ b/drivers/net/vxlan.c @@ -2778,10 +2778,19 @@ static void vxlan_vs_add_dev(struct vxla /* Setup stats when device is created */ static int vxlan_init(struct net_device *dev) { + struct vxlan_dev *vxlan = netdev_priv(dev); + int err; + dev->tstats = netdev_alloc_pcpu_stats(struct pcpu_sw_netstats); if (!dev->tstats) return -ENOMEM; + err = gro_cells_init(&vxlan->gro_cells, dev); + if (err) { + free_percpu(dev->tstats); + return err; + } + return 0; } @@ -3042,8 +3051,6 @@ static void vxlan_setup(struct net_devic vxlan->dev = dev; - gro_cells_init(&vxlan->gro_cells, dev); - for (h = 0; h < FDB_HASH_SIZE; ++h) { spin_lock_init(&vxlan->hash_lock[h]); INIT_HLIST_HEAD(&vxlan->fdb_head[h]);