]> www.infradead.org Git - users/jedix/linux-maple.git/commit
bnxt_en: Fix NULL pointer dereference at bnxt_free_irq().
authorMichael Chan <michael.chan@broadcom.com>
Wed, 11 Apr 2018 15:50:18 +0000 (11:50 -0400)
committerBrian Maly <brian.maly@oracle.com>
Wed, 27 Feb 2019 19:46:56 +0000 (14:46 -0500)
commitcaba0fc7788eb44e2cfa1e79e9059a502f2438ca
treed15a37e94342e32e79ee36a2f1365d8f7dd13782
parentf8043ff2260e4754ac40c78eb6cc1112d54e11e1
bnxt_en: Fix NULL pointer dereference at bnxt_free_irq().

Orabug: 29357977

When open fails during ethtool -L ring change, for example, the driver
may crash at bnxt_free_irq() because bp->bnapi is NULL.

If we fail to allocate all the new rings, bnxt_open_nic() will free
all the memory including bp->bnapi.  Subsequent call to bnxt_close_nic()
will try to dereference bp->bnapi in bnxt_free_irq().

Fix it by checking for !bp->bnapi in bnxt_free_irq().

Fixes: e5811b8c09df ("bnxt_en: Add IRQ remapping logic.")
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit cb98526bf9b985866d648dbb9c983ba9eb59daba)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
drivers/net/ethernet/broadcom/bnxt/bnxt.c