]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Jun 2020 06:23:33 +0000 (08:23 +0200)
commit53fb3d209f1824b8de309df5ef3789615439c0b4
tree882090307e2fb33789fb5aa4331b59569247fa56
parent6b87c4ecd4757661bd10046896f87ad063ec7d58
bnxt_en: fix firmware message length endianness

commit 2a5a8800fa915bd9bc272c91ca64728e6aa84c0a upstream.

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: 845adfe40c2a ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/broadcom/bnxt/bnxt.c
drivers/net/ethernet/broadcom/bnxt/bnxt.h