lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d13f6f33-7489-4e70-8b7b-401d2200a5a7@linux.dev>
Date: Thu, 22 Jan 2026 18:11:20 +0000
From: Vadim Fedorenko <vadim.fedorenko@...ux.dev>
To: Zilin Guan <zilin@....edu.cn>, vburru@...vell.com
Cc: sedara@...vell.com, andrew+netdev@...n.ch, davem@...emloft.net,
 edumazet@...gle.com, kuba@...nel.org, pabeni@...hat.com,
 netdev@...r.kernel.org, linux-kernel@...r.kernel.org, jianhao.xu@....edu.cn
Subject: Re: [PATCH net] octeon_ep: Fix memory leak in octep_device_setup()

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@....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@...ux.dev>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ