From: "Renyong Wan" <wanry@yunsilicon.com>
To: <dev@dpdk.org>
Cc: "Stephen Hemminger" <stephen@networkplumber.org>,
<nana@yunsilicon.com>, <qianr@yunsilicon.com>,
<zhangxx@yunsilicon.com>, <xudw@yunsilicon.com>,
<stable@dpdk.org>
Subject: [PATCH v5 3/4] net/xsc: check Tx queue allocation result
Date: Sun, 22 Nov 2026 22:22:37 +0800 [thread overview]
Message-ID: <1795357357.432789@yunsilicon.com> (raw)
In-Reply-To: <1795357356.312312@yunsilicon.com>
xsc_ethdev_tx_queue_setup() misses the NULL check on the
rte_malloc_socket() result. Return -ENOMEM, as the Rx path does.
Fixes: 488262986eee ("net/xsc: support Rx and Tx queue setup")
Cc: stable@dpdk.org
Reported-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Renyong Wan <wanry@yunsilicon.com>
---
drivers/net/xsc/xsc_ethdev.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/net/xsc/xsc_ethdev.c b/drivers/net/xsc/xsc_ethdev.c
index 20d6f58f..a5c3e4a6 100644
--- a/drivers/net/xsc/xsc_ethdev.c
+++ b/drivers/net/xsc/xsc_ethdev.c
@@ -545,6 +545,12 @@ xsc_ethdev_tx_queue_setup(struct rte_eth_dev *dev, uint16_t idx, uint16_t desc,
txq = rte_malloc_socket(NULL, sizeof(*txq) + desc_n * sizeof(struct rte_mbuf *),
RTE_CACHE_LINE_SIZE, socket);
+ if (txq == NULL) {
+ PMD_DRV_LOG(ERR, "Port %u create txq idx %d failure",
+ dev->data->port_id, idx);
+ rte_errno = ENOMEM;
+ return -rte_errno;
+ }
txq->offloads = conf->offloads | dev->data->dev_conf.txmode.offloads;
txq->priv = priv;
txq->socket = socket;
next prev parent reply other threads:[~2026-11-22 14:23 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-22 14:22 [PATCH v5 0/4] net/xsc: fix issues reported by GCC analyzer Renyong Wan
2026-11-22 14:22 ` [PATCH v5 1/4] net/xsc: fix jumbo buffer allocation and leak Renyong Wan
2026-11-22 14:22 ` [PATCH v5 2/4] net/xsc: fix leak on device init failure Renyong Wan
2026-11-22 14:22 ` Renyong Wan [this message]
2026-11-22 14:22 ` [PATCH v5 4/4] net/xsc: rename jumbo buffer fields Renyong Wan
2026-11-22 17:47 ` [PATCH v5 0/4] net/xsc: fix issues reported by GCC analyzer Stephen Hemminger
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=1795357357.432789@yunsilicon.com \
--to=wanry@yunsilicon.com \
--cc=dev@dpdk.org \
--cc=nana@yunsilicon.com \
--cc=qianr@yunsilicon.com \
--cc=stable@dpdk.org \
--cc=stephen@networkplumber.org \
--cc=xudw@yunsilicon.com \
--cc=zhangxx@yunsilicon.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.