Netdev List
 help / color / mirror / Atom feed
From: Chenguang Zhao <chenguang.zhao@linux.dev>
To: bh74.an@samsung.com, andrew+netdev@lunn.ch, davem@davemloft.net,
	edumazet@google.com, kuba@kernel.org, pabeni@redhat.com
Cc: netdev@vger.kernel.org, chenguang.zhao@linux.dev,
	Chenguang Zhao <zhaochenguang@kylinos.cn>
Subject: [PATCH net v3 0/2] net: sxgbe: fix descriptor ring allocation failure handling
Date: Thu, 23 Jul 2026 10:18:18 +0800	[thread overview]
Message-ID: <20260723021820.203960-1-chenguang.zhao@linux.dev> (raw)

From: Chenguang Zhao <zhaochenguang@kylinos.cn>

init_dma_desc_rings() leaks already-allocated TX rings
when RX allocation fails, and sxgbe_open() ignores its
return value and continues with invalid DMA rings. Fix
the cleanup path and check the error.

Patch 1 frees TX rings on RX allocation failure.
Patch 2 makes sxgbe_open() handle init_dma_desc_rings() failure.

Chenguang Zhao (2):
  net: sxgbe: free TX rings on RX allocation failure
  net: sxgbe: check descriptor ring allocation failures

 drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

---
v3:
- Patch 1: Per Vadim’s suggestion, reuse the existing
  code for cleaning up Tx rings

v2:
 https://lore.kernel.org/all/20260722014055.157269-1-chenguang.zhao@linux.dev/

v1:
 https://lore.kernel.org/all/20260720024747.504493-1-chenguang.zhao@linux.dev/
-- 
2.25.1

             reply	other threads:[~2026-07-23  2:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-23  2:18 Chenguang Zhao [this message]
2026-07-23  2:18 ` [PATCH net v3 1/2] net: sxgbe: free TX rings on RX allocation failure Chenguang Zhao
2026-07-23  2:18 ` [PATCH net v3 2/2] net: sxgbe: check descriptor ring allocation failures Chenguang Zhao

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=20260723021820.203960-1-chenguang.zhao@linux.dev \
    --to=chenguang.zhao@linux.dev \
    --cc=andrew+netdev@lunn.ch \
    --cc=bh74.an@samsung.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=zhaochenguang@kylinos.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