From: Oleksandr Kolomeiets <okl-...@napatech.com>

Macro DO_COMPARE_INDEXS expects pointer to array.
If condition is true, one of array's elements get overwritten.
Misinterpreting pointer to pointer as pointer to array
may result in out-of-bounds access.

Coverity issue: 448966, 448970, 448971, 448972
Fixes: 6e8b7f11205f ("net/ntnic: add categorizer (CAT) FPGA module")

Signed-off-by: Oleksandr Kolomeiets <okl-...@napatech.com>
---
 drivers/net/ntnic/include/hw_mod_backend.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ntnic/include/hw_mod_backend.h 
b/drivers/net/ntnic/include/hw_mod_backend.h
index 544962751a..1941692ddf 100644
--- a/drivers/net/ntnic/include/hw_mod_backend.h
+++ b/drivers/net/ntnic/include/hw_mod_backend.h
@@ -111,7 +111,7 @@ enum {
 
 #define DO_COMPARE_INDEXS(be_module_reg, type, idx, cmp_idx)                   
                   \
        do {                                                                    
                  \
-               typeof(be_module_reg) *temp_be_module = &(be_module_reg);       
              \
+               typeof(be_module_reg) temp_be_module = (be_module_reg);         
            \
                typeof(idx) tmp_idx = (idx);                                    
              \
                typeof(cmp_idx) tmp_cmp_idx = (cmp_idx);                        
              \
                if ((unsigned int)(tmp_idx) != (unsigned int)(tmp_cmp_idx))     
                \
-- 
2.45.0

Reply via email to