From: Laurence Oberman <loberman@redhat.com>
To: Colin King <colin.king@canonical.com>,
Boris Pismenny <borisp@nvidia.com>,
Saeed Mahameed <saeedm@nvidia.com>,
Leon Romanovsky <leon@kernel.org>,
"David S . Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>, Raed Salem <raeds@nvidia.com>,
Huy Nguyen <huyn@mellanox.com>,
netdev@vger.kernel.org, linux-rdma@vger.kernel.org
Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH][next] net/mlx5: Fix bit-wise and with zero
Date: Tue, 06 Apr 2021 17:13:36 -0400 [thread overview]
Message-ID: <fe8cdf3bede40b46716bf94b0760db6d47a13187.camel@redhat.com> (raw)
In-Reply-To: <20210406165346.430535-1-colin.king@canonical.com>
On Tue, 2021-04-06 at 17:53 +0100, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> The bit-wise and of the action field with
> MLX5_ACCEL_ESP_ACTION_DECRYPT
> is incorrect as MLX5_ACCEL_ESP_ACTION_DECRYPT is zero and not
> intended
> to be a bit-flag. Fix this by using the == operator as was originally
> intended.
>
> Addresses-Coverity: ("Logically dead code")
> Fixes: 7dfee4b1d79e ("net/mlx5: IPsec, Refactor SA handle creation
> and destruction")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
> drivers/net/ethernet/mellanox/mlx5/core/fpga/ipsec.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/fpga/ipsec.c
> b/drivers/net/ethernet/mellanox/mlx5/core/fpga/ipsec.c
> index d43a05e77f67..0b19293cdd74 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/fpga/ipsec.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/fpga/ipsec.c
> @@ -850,7 +850,7 @@ mlx5_fpga_ipsec_release_sa_ctx(struct
> mlx5_fpga_ipsec_sa_ctx *sa_ctx)
> return;
> }
>
> - if (sa_ctx->fpga_xfrm->accel_xfrm.attrs.action &
> + if (sa_ctx->fpga_xfrm->accel_xfrm.attrs.action ==
> MLX5_ACCEL_ESP_ACTION_DECRYPT)
> ida_free(&fipsec->halloc, sa_ctx->sa_handle);
>
Looks correct to me with enum mlx5_accel_esp_action action;
Reviewed-by Laurence Oberman <loberman@redhat.com>
prev parent reply other threads:[~2021-04-06 21:13 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-06 16:53 [PATCH][next] net/mlx5: Fix bit-wise and with zero Colin King
2021-04-06 21:13 ` Laurence Oberman [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=fe8cdf3bede40b46716bf94b0760db6d47a13187.camel@redhat.com \
--to=loberman@redhat.com \
--cc=borisp@nvidia.com \
--cc=colin.king@canonical.com \
--cc=davem@davemloft.net \
--cc=huyn@mellanox.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=kuba@kernel.org \
--cc=leon@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=raeds@nvidia.com \
--cc=saeedm@nvidia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).