net/bnxt: fix error handling in VNIC prepare
authorKalesh AP <kalesh-anakkur.purayil@broadcom.com>
Mon, 31 May 2021 07:26:39 +0000 (12:56 +0530)
committerAjit Khaparde <ajit.khaparde@broadcom.com>
Tue, 8 Jun 2021 22:10:25 +0000 (00:10 +0200)
commit4171ac66e5d3e2cef0f8e619b75883f9fe5adf12
tree399d6f2002d27cdf2240480d9b5ff054634c9d59
parentb93fe4db51c102f5fdb775c28b998197e6fb75c7
net/bnxt: fix error handling in VNIC prepare

Resources should be freed on error conditions. i.e, VNIC and
VNIC context created in HW and memory allocated in
bnxt_vnic_grp_alloc() should be freed.

Added a new function bnxt_vnic_destroy() to do the cleanup.
This lightweight function can be used in flow destroy/flush
path to avoid duplicate code as well.

Fixes: d24610f7bfda ("net/bnxt: allow flow creation when RSS is enabled")
Cc: stable@dpdk.org
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
drivers/net/bnxt/bnxt_flow.c