bnxt_en: Fix ethtool selftest crash under error conditions.
authorMichael Chan <michael.chan@broadcom.com>
Sat, 29 Jun 2019 15:16:45 +0000 (11:16 -0400)
committerDavid S. Miller <davem@davemloft.net>
Sun, 30 Jun 2019 23:00:26 +0000 (16:00 -0700)
commitd27e2ca1166aefd54d9c48fb6647dee8115a5dfc
treea7b44ae08f0a0bbe37d18de07a5f193150bf58ba
parentc20dc142dd7b2884b8570eeab323bcd4a84294fa
bnxt_en: Fix ethtool selftest crash under error conditions.

After ethtool loopback packet tests, we re-open the nic for the next
IRQ test.  If the open fails, we must not proceed with the IRQ test
or we will crash with NULL pointer dereference.  Fix it by checking
the bnxt_open_nic() return code before proceeding.

Reported-by: Somasundaram Krishnasamy <somasundaram.krishnasamy@oracle.com>
Fixes: 67fea463fd87 ("bnxt_en: Add interrupt test to ethtool -t selftest.")
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c