Skip to contentSkip to conversation

net: mvpp2: cls: Fix leaked ethtool_rx_flow_rule

PATCH Applied Maxime Chevallier 2 participants 2 messages May 23, 2019

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: mvpp2: cls: Fix leaked ethtool_rx_flow_rule

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")
---
 drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.c +3 -0
index d046f7a1dcf5..a57d17ab91f0 100644
@@ -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++;
Signature · 1 line
2.20.1
maintainer Applied
#1 lore raw

From: Maxime Chevallier <[email protected]>
Date: Thu, 23 May 2019 10:47:24 +0200

Quoted 6 lines

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")

Applied, thanks Maxime.