All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net/nbl: fix late device data check in configure callback
@ 2026-12-02 11:24 Oleg Kotkov
  2026-12-03 21:22 ` Stephen Hemminger
  0 siblings, 1 reply; 2+ messages in thread
From: Oleg Kotkov @ 2026-12-02 11:24 UTC (permalink / raw)
  To: dimon.zhao, leon.yu, sam.chen; +Cc: dev, Oleg Kotkov, stable

nbl_dev_configure() reads eth_dev->data->dev_private before checking
whether eth_dev->data is NULL. Move the adapter lookup after the check
so the callback can return -EINVAL when device data is missing.

Fixes: 93b38df5a2ec ("net/nbl: support basic configuration")
Cc: stable@dpdk.org

Signed-off-by: Oleg Kotkov <Oleg.Kotkov@kaspersky.com>
---
When backporting to 25.11, also move the rx_mq_mode read below the
device data check.

 drivers/net/nbl/nbl_dev/nbl_dev.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/drivers/net/nbl/nbl_dev/nbl_dev.c b/drivers/net/nbl/nbl_dev/nbl_dev.c
index d28eea082f..1ab38efa81 100644
--- a/drivers/net/nbl/nbl_dev/nbl_dev.c
+++ b/drivers/net/nbl/nbl_dev/nbl_dev.c
@@ -13,11 +13,16 @@ static int nbl_dev_port_configure(struct nbl_adapter *adapter)
 
 int nbl_dev_configure(struct rte_eth_dev *eth_dev)
 {
-	struct rte_eth_dev_data *dev_data = eth_dev->data;
-	struct nbl_adapter *adapter = ETH_DEV_TO_NBL_DEV_PF_PRIV(eth_dev);
+	struct rte_eth_dev_data *dev_data;
+	struct nbl_adapter *adapter;
 	int ret;
 
-	if (dev_data == NULL || adapter == NULL)
+	dev_data = eth_dev->data;
+	if (dev_data == NULL)
+		return -EINVAL;
+
+	adapter = ETH_DEV_TO_NBL_DEV_PF_PRIV(eth_dev);
+	if (adapter == NULL)
 		return -EINVAL;
 
 	NBL_LOG(DEBUG, "Begin to configure the device, state: %d", adapter->state);
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-12-03 21:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-02 11:24 [PATCH] net/nbl: fix late device data check in configure callback Oleg Kotkov
2026-12-03 21:22 ` Stephen Hemminger

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.