Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4634692pxj; Wed, 12 May 2021 09:42:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwpWrScQ839HQqjk0yTkVNliQ4HfO22LA+/P8HrSF7nRo4b3fHyfkfngHyKFlLsu4Q+zY0G X-Received: by 2002:a05:6402:5244:: with SMTP id t4mr27231235edd.228.1620837770912; Wed, 12 May 2021 09:42:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620837770; cv=none; d=google.com; s=arc-20160816; b=QsT1filwhK461avlJDn0iTzmKEvE0qknSHjum3sk8q26PKY10g/ZBSbvlh6qUA1P8M XyvZFd6Srl6VrVEM5re6bjRL62/LY6D9EGaGOFOlw+j2ljmOtZBMGbpUo2yNJwT7Ab/z 62GX42vSr085/HrY/63bLl3YC0EEyixoOqjze0DYWBmQ4ifWygPSV5GPyxRBjriAihal wivs0onx6BqU6xT6yOaTHkmJ2bJqMl2puJ4Q8xtIUgnDMrZ3oC6v0A88cFYi8L7qgJdU lwBLbI4mNMz7tklReK0Nla+5CApdoOG379bpcjdf3zhwbe8fGE7wr/71mVjzsgXUqHQs Ri6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=4dvrJVKErBJVOGW0y/SI6sUFepANWEfBIFT7gWRG1OA=; b=DCr9gObeCmOhk4MhP9Mjjh7iyYhfT5v5lZPC8MeRiFYW919hTwN2m9VfJtd3KwXRuX P3rt6UCDX8vnQE0bGgP+Ce0Ie0BG5UPoFAoFF/Q2iX12OvNA0vHLUbb6PSvRk+D6Q0ze Kn++4xFOJARhyhRpUrqD5wY15yB0x2npQZJ67sQWrV60TKt4awGW00IdiEsj2hg+cqGv re4iUTc4IMidj+MSJZwIyg7stxhVlpteJnKF+miXnaWAmCxsv1AGHC/oaABD7YkgR4DW 6jroFuNvhlZeoPw/ZzoXuf89CVz2hC5Cht3avGJxZPfL7syHCRD8vDLj8J9dsqF3XDqC 8zjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=gfAwTEcp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i26si97259edr.106.2021.05.12.09.42.27; Wed, 12 May 2021 09:42:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=gfAwTEcp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242598AbhELQfN (ORCPT + 99 others); Wed, 12 May 2021 12:35:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:41538 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233909AbhELPnG (ORCPT ); Wed, 12 May 2021 11:43:06 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 994B161C85; Wed, 12 May 2021 15:22:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620832935; bh=dO3+MpS8nYIZjeo0TclKHpYAABOpa2lmNKT0CUcdCN0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gfAwTEcp9tXqmUa/V+JPxRPad8wdUQMGgVBAZvzbiywM64A+E1xJA6TB/MGbkEQpe xmc9BlLtEGJYa3bQOb27H0zlwMfViYaqJ+5Z72pmTDv9zjUvI11QlYxHqJj7mR6Z+8 brVBLZCDQewB0q9dO2xfGNy1bF0djBTYlw6nzzfk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Colin Ian King , Saeed Mahameed , Sasha Levin Subject: [PATCH 5.10 447/530] net/mlx5: Fix bit-wise and with zero Date: Wed, 12 May 2021 16:49:17 +0200 Message-Id: <20210512144834.460832842@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210512144819.664462530@linuxfoundation.org> References: <20210512144819.664462530@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Colin Ian King [ Upstream commit 82c3ba31c370b6001cbf90689e98da1fb6f26aef ] 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 Signed-off-by: Saeed Mahameed Signed-off-by: Sasha Levin --- 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 cc67366495b0..bed154e9a1ef 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_simple_remove(&fipsec->halloc, sa_ctx->sa_handle); -- 2.30.2