]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
emulex/benet: correct command version selection in be_cmd_get_stats()
authorAlok Tiwari <alok.a.tiwari@oracle.com>
Mon, 19 May 2025 14:17:19 +0000 (07:17 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 27 Jun 2025 10:05:31 +0000 (11:05 +0100)
commitadd1804ea2e08972f2556a3048eb9badf4ff09ad
tree2202692336029f6574334b3153e07ecc21c1a33f
parentb0e79c9cc2074c2546fe3c451f748d4152c5c22c
emulex/benet: correct command version selection in be_cmd_get_stats()

[ 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 <alok.a.tiwari@oracle.com>
Link: https://patch.msgid.link/20250519141731.691136-1-alok.a.tiwari@oracle.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/emulex/benet/be_cmds.c