From: Ajit Khaparde Date: Tue, 1 Dec 2020 20:52:53 +0000 (-0800) Subject: net/bnxt: fix cleanup on mutex init failure X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=5bbf650b7105f867145664bfe1feeba06386a0d8;p=dpdk.git net/bnxt: fix cleanup on mutex init failure In case mutex init fails during initialization, start cleanup and fail the initialization process. Fixes: a73b8e939f10 ("net/bnxt: fix race between start and interrupt handler") Cc: stable@dpdk.org Signed-off-by: Ajit Khaparde Acked-by: Lance Richardson --- diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c index 33358779bb..0b14ca2342 100644 --- a/drivers/net/bnxt/bnxt_ethdev.c +++ b/drivers/net/bnxt/bnxt_ethdev.c @@ -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)