From: Simon Horman <horms@kernel.org>
To: ernis@linux.microsoft.com
Cc: Simon Horman <horms@kernel.org>,
pabeni@redhat.com, edumazet@google.com,
ssengar@linux.microsoft.com, dipayanroy@linux.microsoft.com,
gargaditya@linux.microsoft.com, decui@microsoft.com,
shacharr@microsoft.com, linux-hyperv@vger.kernel.org,
kotaranov@microsoft.com, kys@microsoft.com,
shirazsaleem@microsoft.com, longli@microsoft.com,
kuba@kernel.org, andrew+netdev@lunn.ch, wei.liu@kernel.org,
linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
haiyangz@microsoft.com, kees@kernel.org,
stephen@networkplumber.org, leon@kernel.org, davem@davemloft.net
Subject: Re: [PATCH net v2 4/4] net: mana: Fix EQ leak in mana_remove on NULL port
Date: Tue, 14 Apr 2026 16:40:58 +0100 [thread overview]
Message-ID: <20260414154058.771241-1-horms@kernel.org> (raw)
In-Reply-To: <20260413050843.605789-5-ernis@linux.microsoft.com>
This is an AI-generated review of your patch. The human sending this
email has considered the AI review valid, or at least plausible.
For local reproduction steps see https://netdev-ai.bots.linux.dev/ai-local.html
---
net: mana: Fix EQ leak in mana_remove on NULL port
In mana_remove(), when a NULL port is encountered in the port iteration
loop, 'goto out' skips the mana_destroy_eq(ac) call, leaking the event
queues allocated earlier by mana_create_eq(). This can happen when
mana_probe_port() fails for port 0, leaving ac->ports[0] as NULL. On
driver unload or error cleanup, mana_remove() hits the NULL entry and
jumps past mana_destroy_eq(). Change 'goto out' to 'break' so the
for-loop exits normally and mana_destroy_eq() is always reached.
> Fixes: ca9c54d2d6a5 ("net: mana: Add a driver for Microsoft Azure Network Adapter (MANA)")
Does this Fixes tag point to the correct commit? Looking at the commit
history, the original driver commit ca9c54d2d6a5 did not have
mana_destroy_eq() in mana_remove() at all, so the 'goto out' pattern could
not have caused an EQ leak at that point.
The bug appears to have been introduced by commit 1e2d0824a9c3 ("net: mana:
Add support for EQ sharing"), which added mana_destroy_eq(ac) to
mana_remove() and placed it after the 'out:' label, making it skippable by
the 'goto out' on NULL port.
Should the Fixes tag be:
Fixes: 1e2d0824a9c3 ("net: mana: Add support for EQ sharing")
next prev parent reply other threads:[~2026-04-14 15:41 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-13 5:08 [PATCH net v2 0/4] net: mana: Fix probe/remove error path bugs Erni Sri Satya Vennela
2026-04-13 5:08 ` [PATCH net v2 1/4] net: mana: Init link_change_work before potential error paths in probe Erni Sri Satya Vennela
2026-04-14 15:41 ` Simon Horman
2026-04-13 5:08 ` [PATCH net v2 2/4] net: mana: Init gf_stats_work " Erni Sri Satya Vennela
2026-04-14 15:41 ` Simon Horman
2026-04-13 5:08 ` [PATCH net v2 3/4] net: mana: Don't overwrite port probe error with add_adev result Erni Sri Satya Vennela
2026-04-14 15:35 ` Simon Horman
2026-04-15 7:04 ` Erni Sri Satya Vennela
2026-04-15 12:37 ` Simon Horman
2026-04-13 5:08 ` [PATCH net v2 4/4] net: mana: Fix EQ leak in mana_remove on NULL port Erni Sri Satya Vennela
2026-04-14 15:40 ` Simon Horman [this message]
2026-04-15 7:01 ` Erni Sri Satya Vennela
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=20260414154058.771241-1-horms@kernel.org \
--to=horms@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=decui@microsoft.com \
--cc=dipayanroy@linux.microsoft.com \
--cc=edumazet@google.com \
--cc=ernis@linux.microsoft.com \
--cc=gargaditya@linux.microsoft.com \
--cc=haiyangz@microsoft.com \
--cc=kees@kernel.org \
--cc=kotaranov@microsoft.com \
--cc=kuba@kernel.org \
--cc=kys@microsoft.com \
--cc=leon@kernel.org \
--cc=linux-hyperv@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=longli@microsoft.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=shacharr@microsoft.com \
--cc=shirazsaleem@microsoft.com \
--cc=ssengar@linux.microsoft.com \
--cc=stephen@networkplumber.org \
--cc=wei.liu@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