Skip to content

Commit

Permalink
net/bnxt: fix cleanup on mutex init failure
Browse files Browse the repository at this point in the history
In case mutex init fails during initialization, start cleanup and
fail the initialization process.

Fixes: a73b8e9 ("net/bnxt: fix race between start and interrupt handler")
Cc: stable@dpdk.org

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Acked-by: Lance Richardson <lance.richardson@broadcom.com>
  • Loading branch information
ajitkhaparde authored and Ferruh Yigit committed Jan 8, 2021
1 parent 4297cad commit 5bbf650
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/net/bnxt/bnxt_ethdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -4739,8 +4739,10 @@ bnxt_init_locks(struct bnxt *bp)
}

err = pthread_mutex_init(&bp->def_cp_lock, NULL);
if (err)
if (err) {
PMD_DRV_LOG(ERR, "Unable to initialize def_cp_lock\n");
return err;
}

err = pthread_mutex_init(&bp->health_check_lock, NULL);
if (err)
Expand Down

0 comments on commit 5bbf650

Please sign in to comment.