mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Kory Maincent <kory.maincent@bootlin.com>
To: Zilin Guan <zilin@seu.edu.cn>
Cc: horms@kernel.org, andrew+netdev@lunn.ch, davem@davemloft.net,
	edumazet@google.com, jianhao.xu@seu.edu.cn, kuba@kernel.org,
	linux-kernel@vger.kernel.org, marco.crivellari@suse.com,
	netdev@vger.kernel.org, pabeni@redhat.com,
	vadim.fedorenko@linux.dev
Subject: Re: [PATCH net v3 1/3] net: liquidio: Fix off-by-one error in PF setup_nic_devices() cleanup
Date: Tue, 27 Jan 2026 17:51:03 +0100	[thread overview]
Message-ID: <20260127175103.19831bd5@kmaincent-XPS-13-7390> (raw)
In-Reply-To: <20260127151241.1144039-2-zilin@seu.edu.cn>

On Tue, 27 Jan 2026 15:12:39 +0000
Zilin Guan <zilin@seu.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@bootlin.com>

Thank you!
-- 
Köry Maincent, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com

  reply	other threads:[~2026-01-27 16:51 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-27 15:12 [PATCH net v3 0/3] net: liquidio: Fix memory leaks in setup_nic_devices() Zilin Guan
2026-01-27 15:12 ` [PATCH net v3 1/3] net: liquidio: Fix off-by-one error in PF setup_nic_devices() cleanup Zilin Guan
2026-01-27 16:51   ` Kory Maincent [this message]
2026-01-27 15:12 ` [PATCH net v3 2/3] net: liquidio: Fix off-by-one error in VF " Zilin Guan
2026-01-27 16:54   ` Kory Maincent
2026-01-27 15:12 ` [PATCH net v3 3/3] net: liquidio: Initialize netdev pointer before queue setup Zilin Guan
2026-01-27 17:04   ` Kory Maincent
2026-01-27 21:05 ` [PATCH net v3 0/3] net: liquidio: Fix memory leaks in setup_nic_devices() Jakub Kicinski
2026-01-28  4:20   ` Zilin Guan

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=20260127175103.19831bd5@kmaincent-XPS-13-7390 \
    --to=kory.maincent@bootlin.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=jianhao.xu@seu.edu.cn \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marco.crivellari@suse.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=vadim.fedorenko@linux.dev \
    --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

all inboxes | Powered by JetHome®