]> git.baikalelectronics.ru Git - kernel.git/commit
bnxt_en: fix firmware message length endianness
authorEdwin Peer <edwin.peer@broadcom.com>
Mon, 25 May 2020 21:41:19 +0000 (17:41 -0400)
committerDavid S. Miller <davem@davemloft.net>
Wed, 27 May 2020 03:30:48 +0000 (20:30 -0700)
commitd4e49f412655a2d3e5b333dd41aeb8f5c14ef7f9
tree723aa1cfaae8ffcfeda918baaeabe3377b332357
parent0ed1c80a6a29ea62ba45e2aa57a0362459bf3dda
bnxt_en: fix firmware message length endianness

The explicit mask and shift is not the appropriate way to parse fields
out of a little endian struct. The length field is internally __le16
and the strategy employed only happens to work on little endian machines
because the offset used is actually incorrect (length is at offset 6).

Also remove the related and no longer used definitions from bnxt.h.

Fixes: e31f292248d1 ("bnxt_en: Improve valid bit checking in firmware response message.")
Signed-off-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/bnxt/bnxt.c
drivers/net/ethernet/broadcom/bnxt/bnxt.h