common/sfc_efx/base: avoid reading past buffer
authorIvan Malov <ivan.malov@oktetlabs.ru>
Thu, 5 Nov 2020 20:46:12 +0000 (23:46 +0300)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 13 Nov 2020 15:26:54 +0000 (16:26 +0100)
commite9d5c5fb6872e885aadbec2baeec47e681e0edc7
treec60d0c6b1c0ae1e586203834e7abd7432cf96a91
parentf1b910746547b25a8e65dc770b452744e21a0ffd
common/sfc_efx/base: avoid reading past buffer

Existing field ID validity check does not validate the field
descriptor availability. Make it more rigorous to avoid
reading past the buffer containing field descriptors.

Coverity issue: 363742
Fixes: 370ed675a952 ("common/sfc_efx/base: support setting PPORT in match spec")

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
drivers/common/sfc_efx/base/efx_mae.c