Skip to content

Commit

Permalink
net/bnxt: handle ring cleanup in case of error
Browse files Browse the repository at this point in the history
[ upstream commit 75915b2 ]

In bnxt_alloc_mem(), after bnxt_alloc_async_ring_struct(),
any of the functions failure causes an error:

bnxt_hwrm_ring_free(): hwrm_ring_free nq failed. rc:1

Fix this by initializing ring->fw_ring_id to INVALID_HW_RING_ID
in bnxt_alloc_async_ring_struct().

Fixes: bd0a14c ("net/bnxt: use dedicated CPR for async events")

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
  • Loading branch information
Kalesh AP authored and bluca committed Feb 14, 2022
1 parent e7f6c76 commit 7ee6d43
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/net/bnxt/bnxt_ring.c
Expand Up @@ -869,6 +869,7 @@ int bnxt_alloc_async_ring_struct(struct bnxt *bp)
ring->ring_mask = ring->ring_size - 1;
ring->vmem_size = 0;
ring->vmem = NULL;
ring->fw_ring_id = INVALID_HW_RING_ID;

bp->async_cp_ring = cpr;
cpr->cp_ring_struct = ring;
Expand Down

0 comments on commit 7ee6d43

Please sign in to comment.