net/bnxt: fix device init error path
authorKalesh AP <kalesh-anakkur.purayil@broadcom.com>
Thu, 18 Jul 2019 03:36:00 +0000 (09:06 +0530)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 23 Jul 2019 12:31:35 +0000 (14:31 +0200)
commit7d2d64c76cb5b0ebacbb989cb8055d3ce2e4c3a1
tree086014b63bffc19a95e13e08d4058a2c1b0eebc7
parent68f589f2c728e7d893b2eacd86aca09b5546d690
net/bnxt: fix device init error path

1. bnxt_dev_init() invokes bnxt_dev_uninit() on failure. So there is
   no need to do individual function cleanups in failure path.
2. rearrange the check for primary process to remove an unwanted goto.
3. fix to invoke bnxt_hwrm_func_buf_unrgtr() in bnxt_dev_uninit() when
   it is needed.

Fixes: b7778e8a1c00 ("net/bnxt: refactor to properly allocate resources for PF/VF")
Cc: stable@dpdk.org
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
drivers/net/bnxt/bnxt_ethdev.c
drivers/net/bnxt/bnxt_hwrm.c