]> git.baikalelectronics.ru Git - kernel.git/commit
bnxt_en: Fix NULL pointer dereference in a failure path during open.
authorMichael Chan <michael.chan@broadcom.com>
Tue, 21 Feb 2017 00:25:17 +0000 (19:25 -0500)
committerDavid S. Miller <davem@davemloft.net>
Tue, 21 Feb 2017 02:59:15 +0000 (21:59 -0500)
commit8e72a13f80008fa0be9ad14f8df95f9b1d3a2ebd
tree02f76b565b4e3fa80bee41bacc1da0c851e92684
parent4225423c98e5b47e8e08543c1fbef61682046025
bnxt_en: Fix NULL pointer dereference in a failure path during open.

If bnxt_hwrm_ring_free() is called during a failure path in bnxt_open(),
it is possible that the completion rings have not been allocated yet.
In that case, the completion doorbell has not been initialized, and
calling bnxt_disable_int() will crash.  Fix it by checking that the
completion ring has been initialized before writing to the completion
ring doorbell.

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