From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BA02016D9BF; Mon, 23 Jun 2025 22:21:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750717267; cv=none; b=H7EQJdZ4fyzJmJmUaas29XfENhQUwyegbRkGVY7S4dBfJ1TXyBGMdx1qc2jP/L36EnCHRtwq9LzWbF/5lYlb41gKO2qWMrJLYBJC9Y5rXHa5zGGOsH65oS4ifj7hz6Vn1t4IpLqoYheqpWseM9hvRMsvwe05AFPl01i7U85138I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750717267; c=relaxed/simple; bh=mf0jVpDRQMYzq1kaagXM+mpE4r7rD4rD5yjapqdIfuM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ULh0LRzaQH0tEtjtpsyMk3ZHF8IbbFug6PdYLWO9esgDu8IREft3c8VCYkSBxIZ/NJ3Ons1F5Kxmz7iqcX1kJYwwcI0PePaEvanp+XI7kXFlNFaVonk08aaRMnyNGIxBMRpSd4gbS1U454+ygn4GQq77bU5py8cpb0sB90NH9QI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=1EmA5vjj; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="1EmA5vjj" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 51C30C4CEEA; Mon, 23 Jun 2025 22:21:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1750717267; bh=mf0jVpDRQMYzq1kaagXM+mpE4r7rD4rD5yjapqdIfuM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1EmA5vjjdhVkMW6kv7iabYxbEHuKD/t0UvXeKt+7SUKR5qpI1jIe5w04aoVgzIdce bxM+WD4dE4FuM5/vq9mqe7b1nFNvUY5xahkcpBZitTxC3got99RjUAx/M/9RT41nxH GgSZinfqrGB9C0NYZ8LwopRPNhTSflS1M2DOqnII= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Alok Tiwari , Jakub Kicinski , Sasha Levin Subject: [PATCH 6.1 392/508] emulex/benet: correct command version selection in be_cmd_get_stats() Date: Mon, 23 Jun 2025 15:07:17 +0200 Message-ID: <20250623130654.917025481@linuxfoundation.org> X-Mailer: git-send-email 2.50.0 In-Reply-To: <20250623130645.255320792@linuxfoundation.org> References: <20250623130645.255320792@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Alok Tiwari [ Upstream commit edb888d29748cee674006a52e544925dacc7728e ] Logic here always sets hdr->version to 2 if it is not a BE3 or Lancer chip, even if it is BE2. Use 'else if' to prevent multiple assignments, setting version 0 for BE2, version 1 for BE3 and Lancer, and version 2 for others. Fixes potential incorrect version setting when BE2_chip and BE3_chip/lancer_chip checks could both be true. Signed-off-by: Alok Tiwari Link: https://patch.msgid.link/20250519141731.691136-1-alok.a.tiwari@oracle.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- drivers/net/ethernet/emulex/benet/be_cmds.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/emulex/benet/be_cmds.c b/drivers/net/ethernet/emulex/benet/be_cmds.c index d00f4e29c9d88..17098cd89dfff 100644 --- a/drivers/net/ethernet/emulex/benet/be_cmds.c +++ b/drivers/net/ethernet/emulex/benet/be_cmds.c @@ -1608,7 +1608,7 @@ int be_cmd_get_stats(struct be_adapter *adapter, struct be_dma_mem *nonemb_cmd) /* version 1 of the cmd is not supported only by BE2 */ if (BE2_chip(adapter)) hdr->version = 0; - if (BE3_chip(adapter) || lancer_chip(adapter)) + else if (BE3_chip(adapter) || lancer_chip(adapter)) hdr->version = 1; else hdr->version = 2; -- 2.39.5