Commit 797d6f91c3993f2dc26372af01c91a29048ec3b3
Committed by
Greg Kroah-Hartman
1 parent
ae4565168a
bnxt_en: Return error if bnxt_alloc_ctx_mem() fails.
[ Upstream commit 0b5b561cea32d5bb1e0a82d65b755a3cb5212141 ] The current code ignores the return value from bnxt_hwrm_func_backing_store_cfg(), causing the driver to proceed in the init path even when this vital firmware call has failed. Fix it by propagating the error code to the caller. Fixes: 1b9394e5a2ad ("bnxt_en: Configure context memory on new devices.") Signed-off-by: Michael Chan <michael.chan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Showing 1 changed file with 4 additions and 4 deletions Side-by-side Diff
drivers/net/ethernet/broadcom/bnxt/bnxt.c
... | ... | @@ -6863,12 +6863,12 @@ |
6863 | 6863 | } |
6864 | 6864 | ena |= FUNC_BACKING_STORE_CFG_REQ_DFLT_ENABLES; |
6865 | 6865 | rc = bnxt_hwrm_func_backing_store_cfg(bp, ena); |
6866 | - if (rc) | |
6866 | + if (rc) { | |
6867 | 6867 | netdev_err(bp->dev, "Failed configuring context mem, rc = %d.\n", |
6868 | 6868 | rc); |
6869 | - else | |
6870 | - ctx->flags |= BNXT_CTX_FLAG_INITED; | |
6871 | - | |
6869 | + return rc; | |
6870 | + } | |
6871 | + ctx->flags |= BNXT_CTX_FLAG_INITED; | |
6872 | 6872 | return 0; |
6873 | 6873 | } |
6874 | 6874 |