[PATCH] net/bnxt: use enum value for interface type check
Kishore Padmanabha
kishore.padmanabha at broadcom.com
Mon Sep 21 21:45:38 CEST 2026
On Tue, Sep 15, 2026 at 5:48 AM Evgeny Sokolov <Evgeny.Sokolov at infotecs.ru>
wrote:
> From: Sokolov Evgeny <Evgeny.Sokolov at infotecs.ru>
>
> Use BNXT_ULP_INTF_TYPE_INVALID when checking the interface type
> returned by ulp_port_db_port_type_get().
>
> Comparing the enum value explicitly makes the code clearer and
> avoids relying on the numeric value of the invalid interface type.
>
> 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/tf_ulp/ulp_rte_parser.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/bnxt/tf_ulp/ulp_rte_parser.c
> b/drivers/net/bnxt/tf_ulp/ulp_rte_parser.c
> index 26823858b5..442a795430 100644
> --- a/drivers/net/bnxt/tf_ulp/ulp_rte_parser.c
> +++ b/drivers/net/bnxt/tf_ulp/ulp_rte_parser.c
> @@ -3108,7 +3108,7 @@ ulp_rte_port_act_handler(const struct
> rte_flow_action *act_item,
>
> /* Get the intf type */
> intf_type = ulp_port_db_port_type_get(param->ulp_ctx, ifindex);
> - if (!intf_type) {
> + if (intf_type == BNXT_ULP_INTF_TYPE_INVALID) {
> BNXT_DRV_DBG(ERR, "Invalid port type\n");
> return BNXT_TF_RC_ERROR;
> }
> --
Acked-by: Kishore Padmanabha <kishore.padmanabha at broadcom.com>
>
> 2.30.2
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mails.dpdk.org/archives/stable/attachments/20260921/6b7ccac8/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/stable/attachments/20260921/6b7ccac8/attachment.bin>
More information about the stable
mailing list