>From c13caa60c5c285d775697e5564d9465b4a22b136 Mon Sep 17 00:00:00 2001
From: Renyong Wan <[email protected]>
Date: Fri, 13 Nov 2026 10:44:50 +0800
Subject: [PATCH 1/2] net/xsc: fix jumbo buffer on IOVA conversion failure
When rte_malloc_virt2iova() fails, the buffer is leaked and the local
jumbo_buffer_va keeps RTE_BAD_IOVA. The next iterations skip the
allocation, as it is no longer NULL, and use that value as the address
of the second data segment.
Free the buffer and reset both variables.
Fixes: 0ff4b93c318f ("net/xsc: support device start")
Cc: [email protected]
Reported-by: Stephen Hemminger <[email protected]>
Signed-off-by: Renyong Wan <[email protected]>
---
drivers/net/xsc/xsc_rx.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/net/xsc/xsc_rx.c b/drivers/net/xsc/xsc_rx.c
index 13b2e269..3324b849 100644
--- a/drivers/net/xsc/xsc_rx.c
+++ b/drivers/net/xsc/xsc_rx.c
@@ -238,8 +238,11 @@ xsc_rxq_initialize(struct xsc_dev *xdev, struct
xsc_rxq_data *rxq_data)
jumbo_buffer_va =
(void
*)rte_malloc_virt2iova(jumbo_buffer_pa);
if ((rte_iova_t)jumbo_buffer_va ==
RTE_BAD_IOVA) {
+ rte_free(jumbo_buffer_pa);
+ jumbo_buffer_pa = NULL;
+ jumbo_buffer_va = NULL;
seg->seg_len = XSC_MAX_RECV_LEN;
- PMD_DRV_LOG(ERR, "Failed to
turn jumbo_buffer");
+ PMD_DRV_LOG(ERR, "Failed to get
IOVA of jumbo_buffer");
continue;
}
}