]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit390f7869029c35387114643988a330eefd5405e7
tree8ce5bd60fa050e461a3c525bac6a5a8d1fa4235c
parentf5d7f89b0ba0d6682f1a5b77162599c218c90443
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: 1982bee3c009 ("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