[PATCH 3/9] net/ice/base: integer overflow issue fix
Dhanya Pillai
dhanya.r.pillai at intel.com
Mon May 26 10:33:05 CEST 2025
From: Lukasz Krakowiak <lukaszx.krakowiak at intel.com>
Fix Coverity issue related to INTEGER_OVERFLOW.
Coverity issue: 1207097
Signed-off-by: Dhanya Pillai <dhanya.r.pillai at intel.com>
---
drivers/net/intel/ice/base/ice_type.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/intel/ice/base/ice_type.h b/drivers/net/intel/ice/base/ice_type.h
index 297a5ea890..757b1d7658 100644
--- a/drivers/net/intel/ice/base/ice_type.h
+++ b/drivers/net/intel/ice/base/ice_type.h
@@ -25,7 +25,7 @@
*/
static inline bool ice_is_pow2(u64 val)
{
- return (val && !(val & (val - 1)));
+ return val != 0 && (val & (val -1)) == 0;
}
/**
--
2.43.0
More information about the dev
mailing list