Skip to content
  • Raed Salem's avatar
    72d3fef1
    net/mlx5: IPsec, Fix coverity issue · 72d3fef1
    Raed Salem authored
    
    
    The cited commit introduced the following coverity issue at functions
    mlx5_fpga_is_ipsec_device() and mlx5_fpga_ipsec_release_sa_ctx():
    - bit_and_with_zero:
      accel_xfrm->attrs.action & MLX5_ACCEL_ESP_ACTION_DECRYPT is always 0.
    
    As MLX5_ACCEL_ESP_ACTION_DECRYPT is not a bitwise flag and was wrongly
    used with bitwise operation, the above expression is always zero value
    as MLX5_ACCEL_ESP_ACTION_DECRYPT is zero.
    
    Fix by using "==" comparison operator instead.
    
    Fixes: 7dfee4b1 ("net/mlx5: IPsec, Refactor SA handle creation and destruction")
    Signed-off-by: default avatarRaed Salem <raeds@mellanox.com>
    Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
    72d3fef1
    net/mlx5: IPsec, Fix coverity issue
    Raed Salem authored
    
    
    The cited commit introduced the following coverity issue at functions
    mlx5_fpga_is_ipsec_device() and mlx5_fpga_ipsec_release_sa_ctx():
    - bit_and_with_zero:
      accel_xfrm->attrs.action & MLX5_ACCEL_ESP_ACTION_DECRYPT is always 0.
    
    As MLX5_ACCEL_ESP_ACTION_DECRYPT is not a bitwise flag and was wrongly
    used with bitwise operation, the above expression is always zero value
    as MLX5_ACCEL_ESP_ACTION_DECRYPT is zero.
    
    Fix by using "==" comparison operator instead.
    
    Fixes: 7dfee4b1 ("net/mlx5: IPsec, Refactor SA handle creation and destruction")
    Signed-off-by: default avatarRaed Salem <raeds@mellanox.com>
    Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
Loading