netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Simon Horman <horms@kernel.org>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Cc: Lorenzo Bianconi <lorenzo@kernel.org>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-mediatek@lists.infradead.org, netdev@vger.kernel.org
Subject: Re: [PATCH v3 1/4] net: airoha: Fix an error handling path in airoha_alloc_gdm_port()
Date: Fri, 16 May 2025 21:16:06 +0100	[thread overview]
Message-ID: <20250516201606.GH3339421@horms.kernel.org> (raw)
In-Reply-To: <5c94b9b345017f29ed653e2f05d25620d128c3f0.1746715755.git.christophe.jaillet@wanadoo.fr>

On Thu, May 15, 2025 at 09:59:35PM +0200, Christophe JAILLET wrote:
> If register_netdev() fails, the error handling path of the probe will not
> free the memory allocated by the previous airoha_metadata_dst_alloc() call
> because port->dev->reg_state will not be NETREG_REGISTERED.
> 
> So, an explicit airoha_metadata_dst_free() call is needed in this case to
> avoid a memory leak.
> 
> Fixes: af3cf757d5c9 ("net: airoha: Move DSA tag in DMA descriptor")
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
> Changes in v3:
>   - None
> 
> Changes in v2:
>   - New patch
> v2: https://lore.kernel.org/all/5c94b9b3850f7f29ed653e2205325620df28c3ff.1746715755.git.christophe.jaillet@wanadoo.fr/
> 
> Compile tested only.

Reviewed-by: Simon Horman <horms@kernel.org>


  parent reply	other threads:[~2025-05-16 20:16 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-15 19:59 [PATCH v3 1/4] net: airoha: Fix an error handling path in airoha_alloc_gdm_port() Christophe JAILLET
2025-05-15 19:59 ` [PATCH v3 2/4] net: airoha: Fix an error handling path in airoha_probe() Christophe JAILLET
2025-05-16 20:16   ` Simon Horman
2025-05-24  8:54     ` Christophe JAILLET
2025-05-17 14:07   ` Lorenzo Bianconi
2025-05-15 19:59 ` [PATCH v3 3/4] net: airoha: Use for_each_child_of_node_scoped() Christophe JAILLET
2025-05-15 19:59 ` [PATCH v3 4/4] net: airoha: Use dev_err_probe() Christophe JAILLET
2025-05-16 20:16   ` Simon Horman
2025-05-17 14:09   ` Lorenzo Bianconi
2025-05-15 21:16 ` [PATCH v3 1/4] net: airoha: Fix an error handling path in airoha_alloc_gdm_port() Lorenzo Bianconi
2025-05-16 20:17   ` Simon Horman
2025-05-16 20:16 ` Simon Horman [this message]
2025-05-16 20:21   ` Simon Horman

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=20250516201606.GH3339421@horms.kernel.org \
    --to=horms@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=christophe.jaillet@wanadoo.fr \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=lorenzo@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /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;
as well as URLs for NNTP newsgroup(s).