Skip to content

Commit edb888d

Browse files
aloktiwakuba-moo
authored andcommitted
emulex/benet: correct command version selection in be_cmd_get_stats()
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>
1 parent 220a29d commit edb888d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/net/ethernet/emulex/benet/be_cmds.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1609,7 +1609,7 @@ int be_cmd_get_stats(struct be_adapter *adapter, struct be_dma_mem *nonemb_cmd)
16091609
/* version 1 of the cmd is not supported only by BE2 */
16101610
if (BE2_chip(adapter))
16111611
hdr->version = 0;
1612-
if (BE3_chip(adapter) || lancer_chip(adapter))
1612+
else if (BE3_chip(adapter) || lancer_chip(adapter))
16131613
hdr->version = 1;
16141614
else
16151615
hdr->version = 2;

0 commit comments

Comments
 (0)