From: Danylo Vodopianov <dvo-...@napatech.com>

Fix overflow issue with checking max bit shifting value.

Coverity issue: 448921
Fixes: 833962ebb893 ("net/ntnic: add CAT module")

Signed-off-by: Danylo Vodopianov <dvo-...@napatech.com>
---
 .../nthw/flow_api/profile_inline/flow_api_profile_inline.c      | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/drivers/net/ntnic/nthw/flow_api/profile_inline/flow_api_profile_inline.c 
b/drivers/net/ntnic/nthw/flow_api/profile_inline/flow_api_profile_inline.c
index a68c3ea702..574e51c2fa 100644
--- a/drivers/net/ntnic/nthw/flow_api/profile_inline/flow_api_profile_inline.c
+++ b/drivers/net/ntnic/nthw/flow_api/profile_inline/flow_api_profile_inline.c
@@ -3605,7 +3605,7 @@ static struct flow_handle *create_flow_filter(struct 
flow_eth_dev *dev, struct n
                        .err_mask_ttl = (fd->ttl_sub_enable &&
                                fd->ttl_sub_outer) ? -1 : 0x1,
                        .ptc_mask_tunnel = fd->tunnel_prot !=
-                               -1 ? (1 << fd->tunnel_prot) : -1,
+                       -1 ? (1 << (fd->tunnel_prot > 10 ? 10 : 
fd->tunnel_prot)) : -1,
                        .ptc_mask_l3_tunnel =
                                fd->tunnel_l3_prot != -1 ? (1 << 
fd->tunnel_l3_prot) : -1,
                        .ptc_mask_l4_tunnel =
-- 
2.45.0

Reply via email to