[PATCH v2] net/bnxt: check backing ethdev after creation
Evgeny Sokolov
Evgeny.Sokolov at infotecs.ru
Tue Nov 17 13:13:50 CET 2026
From: Sokolov Evgeny <Evgeny.Sokolov at infotecs.ru>
Check whether the backing Ethernet device was successfully retrieved.
If the device is not found, return -ENODEV
Signed-off-by: Sokolov Evgeny <Evgeny.Sokolov at infotecs.ru>
---
v2 changes:
- remove the braces for the if condition
- v1: https://mails.dpdk.org/archives/dev/2026-November/351284.html
drivers/net/bnxt/bnxt_ethdev.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 4ecd2effdf..7e87cb93a6 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -6999,6 +6999,8 @@ static int bnxt_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
return ret;
backing_eth_dev = rte_eth_dev_allocated(pci_dev->device.name);
+ if (backing_eth_dev == NULL)
+ return -ENODEV;
}
PMD_DRV_LOG_LINE(DEBUG, "BNXT Port:%d pci probe",
backing_eth_dev->data->port_id);
--
2.30.2
More information about the dev
mailing list