Received: by 2002:a25:86ce:0:0:0:0:0 with SMTP id y14csp1490935ybm; Thu, 23 May 2019 01:49:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqwj/ox5n5czWf97wT/S6YJo1+VaeccsyjjTrWpFcYrXVbAgZ4i0jYqVAnNE+gDuW8XIbHxG X-Received: by 2002:a17:902:7615:: with SMTP id k21mr49325395pll.253.1558601396817; Thu, 23 May 2019 01:49:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558601396; cv=none; d=google.com; s=arc-20160816; b=O+DfIO5zSm8OtyBjfjwSSD+ESo5Xwnwj0QVVn0TkF7G//Og2SXTB6U7Vpv5PZJsiFx SfRZuQ5t0JlZkZe9A9ARe5/f460DTo2U9d8ch7CzDowB1rZmjWuBOqPVvOy+GAjpwRH3 rgQFTWso6sia0hLltpvHnwnGJq+XazokDzGDhyWY0c67/slVmEGRLliVBhdyR6/kAwyD FRUsqXrxnoAdsT0E3nk+qf43qfVz+d1aB/Nt2o1bG/Qc9Ejegnmxp0pJxoJDLDTX70cu 9AKxzzaMlpUd97pmkk4g5JsobTYsZgXIpCuqucXGnQaqFzgxmTjT0dQINIe1ti7bhSBp IsHQ== 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 :message-id:date:subject:cc:to:from; bh=ygZX7IcoOxAhsBt9FZ3UM+LNHIfQA0IsvRbsUeKQ898=; b=owjbNPsM1yaVhZDaJrfvmcyo6aZtkJEOUJduDDTOItBxFZhv3qIpg2TiFTAaEcM6V4 /xkkebrCctfxUQ1cKDGYpi/4yVSr+pNOhRgN0muq2PGF5JlwttE+LVIHfM7g3ugjCD/o 1n+yIzpzCLbyRMo2vydSKNenPpKzib/e4/iD+hRT/zPIjtzYJ0OuUvnh9X+svTgHGbF/ HQ4xb5+5LlqgcFAFyw5raY4uTn6K/Q1n5DFoVBlwTSx1/LlIhto7sAsCU1/QLX3EbTDe 8t4k2S5JE8ywlAI/hnchanJ9bJk8iRZKsWv2IuPoChUWihs5AJ/XKIPxWVfxys1MaAQJ qzUA== ARC-Authentication-Results: i=1; mx.google.com; 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 u1si8778103pgo.595.2019.05.23.01.49.40; Thu, 23 May 2019 01:49:56 -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; 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 S1730012AbfEWIre (ORCPT + 99 others); Thu, 23 May 2019 04:47:34 -0400 Received: from relay7-d.mail.gandi.net ([217.70.183.200]:58339 "EHLO relay7-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726070AbfEWIrd (ORCPT ); Thu, 23 May 2019 04:47:33 -0400 X-Originating-IP: 90.88.22.185 Received: from mc-bl-xps13.lan (aaubervilliers-681-1-80-185.w90-88.abo.wanadoo.fr [90.88.22.185]) (Authenticated sender: maxime.chevallier@bootlin.com) by relay7-d.mail.gandi.net (Postfix) with ESMTPSA id 309EC20008; Thu, 23 May 2019 08:47:22 +0000 (UTC) From: Maxime Chevallier To: davem@davemloft.net Cc: Maxime Chevallier , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Antoine Tenart , thomas.petazzoni@bootlin.com, gregory.clement@bootlin.com, miquel.raynal@bootlin.com, nadavh@marvell.com, stefanc@marvell.com, mw@semihalf.com Subject: [PATCH net] net: mvpp2: cls: Fix leaked ethtool_rx_flow_rule Date: Thu, 23 May 2019 10:47:24 +0200 Message-Id: <20190523084724.14639-1-maxime.chevallier@bootlin.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The flow_rule is only used when configuring the classification tables, and should be free'd once we're done using it. The current code only frees it in the error path. Fixes: 90b509b39ac9 ("net: mvpp2: cls: Add Classification offload support") Signed-off-by: Maxime Chevallier --- drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.c b/drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.c index d046f7a1dcf5..a57d17ab91f0 100644 --- a/drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.c +++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.c @@ -1271,6 +1271,9 @@ int mvpp2_ethtool_cls_rule_ins(struct mvpp2_port *port, if (ret) goto clean_eth_rule; + ethtool_rx_flow_rule_destroy(ethtool_rule); + efs->rule.flow = NULL; + memcpy(&efs->rxnfc, info, sizeof(*info)); port->rfs_rules[efs->rule.loc] = efs; port->n_rfs_rules++; -- 2.20.1