Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp724594pxb; Tue, 2 Feb 2021 16:47:07 -0800 (PST) X-Google-Smtp-Source: ABdhPJxDx2V907vSaoDlgURG1Vzn0GiBBsKHFtJ9W63mXtZAtRJze6tMjcGeDcv6UNqpzvfj4h2d X-Received: by 2002:a05:6402:110b:: with SMTP id u11mr658075edv.57.1612313227500; Tue, 02 Feb 2021 16:47:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612313227; cv=none; d=google.com; s=arc-20160816; b=iRUR7XCui5bktWLAxCg29W3g6lIOm33pBKeRXzF0YP5GMFTNBjLhlDjz+kL8Zn36l7 UWEHeiB9NsOVEyv/T13fMX+IRHE+yuJV2GuxrIOP31ybmUqjfjTKEixiU2JsyjHs/vzI J3RUCd7LwHRS5B/5HhPsEoY1HqdDy0uXo+ZunBlYmSHkeJa5xKRY8f0/n2CGEkN8QMWK iJnYWXGAZC0qYZcpCmLN5CNib7A2vcn7x8UAk6CRSP6sNfOeJwC+TyAkSfzqBJ7X+JRO j405uILODyp9Ybzpz+MBfzPcHGOpJv3L1gyDiOTQJzGmNJFmngK2/f9deB8RGSD3m0+N qQ0g== 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=5SRz6oqFr9QXn+tZS9L5MkId+EvU06dB+MmiQxFWVXI=; b=HyFF+0rLq1+709j1HJkABw9DlzOsYm0uiEcRx1LmHstGV+PpP3ZM5KNAvgXRVQYHFh KggTr371VENdLkCauYW34i7sy8v/Vc5e4KTOLTorjAV+0K788BC9Xzp7D6r8XNvUPVzP Ykj8CHsTWW/MBpjmA0WYwREyQacBeacZCVOSUYms4d7e6PgW3Ac+KZE1v+58G7McrFlx dP+TS7+VkE9nF5DURXTmnvED/O4fRGHlAjyMrIsbMM5Al1cOUzHrDeLoF8ITyToP1TCo ppsSkZyl4U71nfmsPRHVuB1HvhIchyQFIl77qDSW0I2R4tvmxIFANY3/8q1SppQxWaap smBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=eODmOX57; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gs15si281462ejb.579.2021.02.02.16.46.43; Tue, 02 Feb 2021 16:47:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=eODmOX57; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.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: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239130AbhBBTdP (ORCPT + 99 others); Tue, 2 Feb 2021 14:33:15 -0500 Received: from mail.kernel.org ([198.145.29.99]:43126 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232954AbhBBN5Y (ORCPT ); Tue, 2 Feb 2021 08:57:24 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 64F8864FE3; Tue, 2 Feb 2021 13:45:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1612273544; bh=GhORz0aQj3aHg5n2dkluzgIHDfVfsEpJGHbD5F2doCA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eODmOX57bYXaMNT70BgxumId5xLkkLvfGmJytPgOZPX9eZ6c2J9qsF8AaxUPNskv5 nmabEwheUsF0cgt8o3IXa3PQyOQpbgEM5h2sao+RADb5Ni76xKSHPkjRu2Ph/hv6GY j8CpIeAzBgADhaRcyhtKbWFpA1i0i7F/6NmjVJEQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Roi Dayan , Maor Dickman , Saeed Mahameed , Sasha Levin Subject: [PATCH 5.10 114/142] net/mlx5: Fix memory leak on flow table creation error flow Date: Tue, 2 Feb 2021 14:37:57 +0100 Message-Id: <20210202133002.412430716@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210202132957.692094111@linuxfoundation.org> References: <20210202132957.692094111@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: Roi Dayan [ Upstream commit 487c6ef81eb98d0a43cb08be91b1fcc9b4250626 ] When we create the ft object we also init rhltable in ft->fgs_hash. So in error flow before kfree of ft we need to destroy that rhltable. Fixes: 693c6883bbc4 ("net/mlx5: Add hash table for flow groups in flow table") Signed-off-by: Roi Dayan Reviewed-by: Maor Dickman Signed-off-by: Saeed Mahameed Signed-off-by: Sasha Levin --- drivers/net/ethernet/mellanox/mlx5/core/fs_core.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c index 9fdd99272e310..634c2bfd25be1 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c @@ -1141,6 +1141,7 @@ static struct mlx5_flow_table *__mlx5_create_flow_table(struct mlx5_flow_namespa destroy_ft: root->cmds->destroy_flow_table(root, ft); free_ft: + rhltable_destroy(&ft->fgs_hash); kfree(ft); unlock_root: mutex_unlock(&root->chain_lock); -- 2.27.0