From: Vadim Fedorenko <vadim.fedorenko@linux.dev>
To: Zilin Guan <zilin@seu.edu.cn>, vburru@marvell.com
Cc: sedara@marvell.com, andrew+netdev@lunn.ch, davem@davemloft.net,
edumazet@google.com, kuba@kernel.org, pabeni@redhat.com,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
jianhao.xu@seu.edu.cn
Subject: Re: [PATCH net] octeon_ep: Fix memory leak in octep_device_setup()
Date: Thu, 22 Jan 2026 18:11:20 +0000 [thread overview]
Message-ID: <d13f6f33-7489-4e70-8b7b-401d2200a5a7@linux.dev> (raw)
In-Reply-To: <20260121130551.3717090-1-zilin@seu.edu.cn>
On 21/01/2026 13:05, Zilin Guan wrote:
> In octep_device_setup(), if octep_ctrl_net_init() fails, the function
> returns directly without unmapping the mapped resources and freeing the
> allocated configuration memory.
>
> Fix this by jumping to the unsupported_dev label, which performs the
> necessary cleanup. This aligns with the error handling logic of other
> paths in this function.
>
> Compile tested only. Issue found using a prototype static analysis tool
> and code review.
>
> Fixes: 577f0d1b1c5f ("octeon_ep: add separate mailbox command and response queues")
> Signed-off-by: Zilin Guan <zilin@seu.edu.cn>
> ---
> drivers/net/ethernet/marvell/octeon_ep/octep_main.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/marvell/octeon_ep/octep_main.c b/drivers/net/ethernet/marvell/octeon_ep/octep_main.c
> index bcea3fc26a8c..57db7ea2f5be 100644
> --- a/drivers/net/ethernet/marvell/octeon_ep/octep_main.c
> +++ b/drivers/net/ethernet/marvell/octeon_ep/octep_main.c
> @@ -1338,7 +1338,7 @@ int octep_device_setup(struct octep_device *oct)
>
> ret = octep_ctrl_net_init(oct);
> if (ret)
> - return ret;
> + goto unsupported_dev;
>
> INIT_WORK(&oct->tx_timeout_task, octep_tx_timeout_task);
> INIT_WORK(&oct->ctrl_mbox_task, octep_ctrl_mbox_task);
Reviewed-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>
next prev parent reply other threads:[~2026-01-22 18:11 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-21 13:05 [PATCH net] octeon_ep: Fix memory leak in octep_device_setup() Zilin Guan
2026-01-22 18:11 ` Vadim Fedorenko [this message]
2026-01-23 19:50 ` 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=d13f6f33-7489-4e70-8b7b-401d2200a5a7@linux.dev \
--to=vadim.fedorenko@linux.dev \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=jianhao.xu@seu.edu.cn \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=sedara@marvell.com \
--cc=vburru@marvell.com \
--cc=zilin@seu.edu.cn \
/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