[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260127175103.19831bd5@kmaincent-XPS-13-7390>
Date: Tue, 27 Jan 2026 17:51:03 +0100
From: Kory Maincent <kory.maincent@...tlin.com>
To: Zilin Guan <zilin@....edu.cn>
Cc: horms@...nel.org, andrew+netdev@...n.ch, davem@...emloft.net,
edumazet@...gle.com, jianhao.xu@....edu.cn, kuba@...nel.org,
linux-kernel@...r.kernel.org, marco.crivellari@...e.com,
netdev@...r.kernel.org, pabeni@...hat.com, vadim.fedorenko@...ux.dev
Subject: Re: [PATCH net v3 1/3] net: liquidio: Fix off-by-one error in PF
setup_nic_devices() cleanup
On Tue, 27 Jan 2026 15:12:39 +0000
Zilin Guan <zilin@....edu.cn> wrote:
> In setup_nic_devices(), the initialization loop jumps to the label
> setup_nic_dev_free on failure. The current cleanup loop while(i--)
> skip the failing index i, causing a memory leak.
>
> Fix this by changing the loop to iterate from the current index i
> down to 0.
>
> Also, decrement i in the devlink_alloc failure path to point to the
> last successfully allocated index.
>
> Compile tested only. Issue found using code review.
Reviewed-by: Kory Maincent <kory.maincent@...tlin.com>
Thank you!
--
Köry Maincent, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com
Powered by blists - more mailing lists