[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20260128042019.1631049-1-zilin@seu.edu.cn>
Date: Wed, 28 Jan 2026 04:20:19 +0000
From: Zilin Guan <zilin@....edu.cn>
To: kuba@...nel.org
Cc: andrew+netdev@...n.ch,
davem@...emloft.net,
edumazet@...gle.com,
horms@...nel.org,
jianhao.xu@....edu.cn,
kory.maincent@...tlin.com,
linux-kernel@...r.kernel.org,
marco.crivellari@...e.com,
netdev@...r.kernel.org,
pabeni@...hat.com,
vadim.fedorenko@...ux.dev,
zilin@....edu.cn
Subject: Re: [PATCH net v3 0/3] net: liquidio: Fix memory leaks in setup_nic_devices()
On Tue, Jan 27, 2026 at 01:05:46PM -0800, Jakub Kicinski wrote:
> On Tue, 27 Jan 2026 15:12:38 +0000 Zilin Guan wrote:
> > This series fixes memory leaks in the initialization paths of the
> > NIC devices.
> >
> > Patch 1 fixes an off-by-one error in the PF cleanup loop. It ensures
> > the current device index is cleaned up and correctly handles the
> > post-loop devlink_alloc failure case.
> >
> > Patch 2 fixes the same off-by-one error in the VF cleanup loop.
> >
> > Patch 3 moves the initialization of oct->props[i].netdev before queue
> > setup calls. This ensures that if queue setup fails, the cleanup function
> > can find and free the allocated netdev. It also initializes lio->oct_dev
> > early to prevent a crash in the cleanup path.
>
> Coccicheck says:
>
> drivers/net/ethernet/cavium/liquidio/lio_main.c:3769:8-9: WARNING: Unsigned expression compared with zero: i >= 0
> drivers/net/ethernet/cavium/liquidio/lio_vf_main.c:2215:8-9: WARNING: Unsigned expression compared with zero: i >= 0
> --
> pw-bot: cr
Apologies for missing the unsigned integer issue here. I was worried
about a potential underflow during the devlink_alloc failure path if
the loop hadn't run, which led to the while (i >= 0) approach. I'll
fix this in v4. Thanks for catching that!
Regards,
Zilin
Powered by blists - more mailing lists