]> git.baikalelectronics.ru Git - kernel.git/commit
bnxt_en: Improve RX consumer index validity check.
authorMichael Chan <michael.chan@broadcom.com>
Mon, 8 Apr 2019 21:39:54 +0000 (17:39 -0400)
committerDavid S. Miller <davem@davemloft.net>
Mon, 8 Apr 2019 23:39:41 +0000 (16:39 -0700)
commit017217ee01650f242fbcacd767f1cdb810666265
treede1a1c7a7bc61d5c8da7436fe956f10f485ad78f
parentf014c452e1384883c0de1c3e025235ed350b9daf
bnxt_en: Improve RX consumer index validity check.

There is logic to check that the RX/TPA consumer index is the expected
index to work around a hardware problem.  However, the potentially bad
consumer index is first used to index into an array to reference an entry.
This can potentially crash if the bad consumer index is beyond legal
range.  Improve the logic to use the consumer index for dereferencing
after the validity check and log an error message.

Fixes: 142b0d0984db ("bnxt_en: Add workaround to detect bad opaque in rx completion (part 2)")
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