Skip to content

Commit

Permalink
net/bnxt: fix cleanup on mutex init failure
Browse files Browse the repository at this point in the history
[ upstream commit 5bbf650 ]

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")

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Acked-by: Lance Richardson <lance.richardson@broadcom.com>
  • Loading branch information
ajitkhaparde authored and cpaelzer committed Feb 2, 2021
1 parent c1420a7 commit 69eb5f9
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 @@ -4765,8 +4765,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 69eb5f9

Please sign in to comment.