mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Wentao Liang <vulab@iscas.ac.cn>
To: Elad Nachman <enachman@marvell.com>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@kernel.org>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	Wentao Liang <vulab@iscas.ac.cn>,
	stable@vger.kernel.org
Subject: [PATCH] net: prestera: release the ruleset in prestera_flower_prio_get
Date: Tue,  3 Nov 2026 10:05:32 +0000	[thread overview]
Message-ID: <20261103100532.1309990-1-vulab@iscas.ac.cn> (raw)

prestera_flower_prio_get() looks up the ruleset with
prestera_acl_ruleset_lookup(), which increments its reference count,
but returns without calling prestera_acl_ruleset_put().

The ruleset reference is leaked on every successful priority query.
Release it after the priority range has been copied out.

Fixes: 44af95718fed ("net: prestera: manage matchall and flower priorities")
Cc: stable@vger.kernel.org
Assisted-by: DeepSeek-V4.1-Flash and OpenAI Codex
Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
---
 drivers/net/ethernet/marvell/prestera/prestera_flower.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/ethernet/marvell/prestera/prestera_flower.c b/drivers/net/ethernet/marvell/prestera/prestera_flower.c
index 58b116cabd48..10d7e149822b 100644
--- a/drivers/net/ethernet/marvell/prestera/prestera_flower.c
+++ b/drivers/net/ethernet/marvell/prestera/prestera_flower.c
@@ -411,6 +411,8 @@ int prestera_flower_prio_get(struct prestera_flow_block *block, u32 chain_index,
 		return PTR_ERR(ruleset);
 
 	prestera_acl_ruleset_prio_get(ruleset, prio_min, prio_max);
+	prestera_acl_ruleset_put(ruleset);
+
 	return 0;
 }
 
-- 
2.34.1


             reply	other threads:[~2026-11-03 10:05 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-03 10:05 Wentao Liang [this message]
2026-11-03 10:09 ` netdev-bot+sinfo
2026-11-03 10:26 ` Krzysztof Kozlowski
2026-11-06 12:17 ` Simon Horman
2026-11-07  5:35   ` Wentao Liang
2026-11-06 23:10 ` patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261103100532.1309990-1-vulab@iscas.ac.cn \
    --to=vulab@iscas.ac.cn \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=enachman@marvell.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®