[PATCH] net/bnxt: check backing ethdev after creation

Kishore Padmanabha kishore.padmanabha at broadcom.com
Mon Nov 16 22:46:47 CET 2026


On Mon, Nov 16, 2026 at 2:39 AM Evgeny Sokolov <Evgeny.Sokolov at infotecs.ru>
wrote:

> 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
>
> Found by InfoTeCS on behalf of Linux Verification Center (linuxtesting.org)
> with SVACE.
>
> Signed-off-by: Sokolov Evgeny <Evgeny.Sokolov at infotecs.ru>
> ---
>  drivers/net/bnxt/bnxt_ethdev.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/drivers/net/bnxt/bnxt_ethdev.c
> b/drivers/net/bnxt/bnxt_ethdev.c
> index 23edd94444..8dcf62f176 100644
> --- a/drivers/net/bnxt/bnxt_ethdev.c
> +++ b/drivers/net/bnxt/bnxt_ethdev.c
> @@ -6994,6 +6994,9 @@ 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;
> +               }
>
Either add a debug error message or remove the braces for the if condition.

>         }
>         PMD_DRV_LOG_LINE(DEBUG, "BNXT Port:%d pci probe",
>                     backing_eth_dev->data->port_id);
> --
> 2.30.2
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mails.dpdk.org/archives/dev/attachments/20261116/333aca6d/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5493 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://mails.dpdk.org/archives/dev/attachments/20261116/333aca6d/attachment.bin>


More information about the dev mailing list