Commit efd5a158 authored by Colin Ian King's avatar Colin Ian King Committed by Jakub Kicinski
Browse files

net: hns3: fix expression that is currently always true



The ||  condition in hdev->fd_active_type != HCLGE_FD_ARFS_ACTIVE ||
hdev->fd_active_type != HCLGE_FD_RULE_NONE will always be true because
hdev->fd_active_type cannot be equal to two different values at the same
time. The expression is always true which is not correct. Fix this by
replacing || with && to correct the logic in the expression.

Addresses-Coverity: ("Constant expression result")
Fixes: 0205ec04 ("net: hns3: add support for hw tc offload of tc flower")
Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
Reviewed-by: default avatarHuazhong Tan <tanhuazhong@huawei.com>
Link: https://lore.kernel.org/r/20201215000033.85383-1-colin.king@canonical.com


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent a268e0f2
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -6485,7 +6485,7 @@ static int hclge_add_fd_entry_by_arfs(struct hnae3_handle *handle, u16 queue_id,
	 * arfs should not work
	 */
	spin_lock_bh(&hdev->fd_rule_lock);
	if (hdev->fd_active_type != HCLGE_FD_ARFS_ACTIVE ||
	if (hdev->fd_active_type != HCLGE_FD_ARFS_ACTIVE &&
	    hdev->fd_active_type != HCLGE_FD_RULE_NONE) {
		spin_unlock_bh(&hdev->fd_rule_lock);
		return -EOPNOTSUPP;