Skip to content

Commit

Permalink
net/bnxt: fix representor info freeing
Browse files Browse the repository at this point in the history
[ upstream commit 5fdf25b ]

Driver allocates "bp->rep_info" inside bnxt_init_rep_info() which is
invoked from bnxt_rep_port_probe(). But the memory is freed inside
bnxt_uninit_resources(), which is wrong. As a result, after error
recovery bp->rep_info will be NULL. The memory should have freed inside
bnxt_drv_uninit() to maintain symmetry of calls.

Fixes: 6dc8323 ("net/bnxt: support port representor data path")

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 kevintraynor committed Oct 11, 2022
1 parent 50e0763 commit b673b37
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/bnxt/bnxt_ethdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -1655,6 +1655,7 @@ static void bnxt_drv_uninit(struct bnxt *bp)
bnxt_free_link_info(bp);
bnxt_free_parent_info(bp);
bnxt_uninit_locks(bp);
bnxt_free_rep_info(bp);

rte_memzone_free((const struct rte_memzone *)bp->tx_mem_zone);
bp->tx_mem_zone = NULL;
Expand Down Expand Up @@ -5978,7 +5979,6 @@ bnxt_uninit_resources(struct bnxt *bp, bool reconfig_dev)

bnxt_free_flow_stats_info(bp);
bnxt_free_switch_domain(bp);
bnxt_free_rep_info(bp);
rte_free(bp->ptp_cfg);
bp->ptp_cfg = NULL;
return rc;
Expand Down

0 comments on commit b673b37

Please sign in to comment.