Skip to content

Commit 5d93a01

Browse files
aloktiwaNipaLocal
authored and
NipaLocal
committed
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. Fixes: 6100086 ("be2net: Call version 2 of GET_STATS ioctl for Skyhawk-R") Signed-off-by: Alok Tiwari <[email protected]> Signed-off-by: NipaLocal <nipa@local>
1 parent e6b037a commit 5d93a01

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)