bnxt_en: Check for zero dir entries in NVRAM.
authorVasundhara Volam <vasundhara-v.volam@broadcom.com>
Wed, 26 Aug 2020 05:08:33 +0000 (01:08 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 12 Sep 2020 09:47:34 +0000 (11:47 +0200)
commit7f3aa14ce1c8a2a2d22da48ca42727d8875d6228
treebdd3ada3f6d35340dda487e42de242239a47bc65
parent8064eaf3a52469936adbb7da7ae32c90492fbdf4
bnxt_en: Check for zero dir entries in NVRAM.

[ Upstream commit dbbfa96ad920c50d58bcaefa57f5f33ceef9d00e ]

If firmware goes into unstable state, HWRM_NVM_GET_DIR_INFO firmware
command may return zero dir entries. Return error in such case to
avoid zero length dma buffer request.

Fixes: c0c050c58d84 ("bnxt_en: New Broadcom ethernet driver.")
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c