net/mlx5: IPsec, Fix coverity issue
authorRaed Salem <raeds@mellanox.com>
Wed, 22 Apr 2020 06:19:08 +0000 (09:19 +0300)
committerSaeed Mahameed <saeedm@mellanox.com>
Thu, 30 Apr 2020 17:10:42 +0000 (10:10 -0700)
commit72d3fef16158b9c1852855a3846757ec165c16e1
tree8ce5bd60fa050e461a3c525bac6a5a8d1fa4235c
parenta6b1b936057e874db52d3e5f0caeb42f11449acf
net/mlx5: IPsec, Fix coverity issue

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: 7dfee4b1d79e ("net/mlx5: IPsec, Refactor SA handle creation and destruction")
Signed-off-by: Raed Salem <raeds@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
drivers/net/ethernet/mellanox/mlx5/core/fpga/ipsec.c