From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id C1D2CA04DB; Thu, 10 Dec 2020 00:56:24 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 32F96C9EC; Thu, 10 Dec 2020 00:54:09 +0100 (CET) Received: from mail-pg1-f193.google.com (mail-pg1-f193.google.com [209.85.215.193]) by dpdk.org (Postfix) with ESMTP id 25D7DC9CE; Thu, 10 Dec 2020 00:54:04 +0100 (CET) Received: by mail-pg1-f193.google.com with SMTP id 69so2445563pgg.8; Wed, 09 Dec 2020 15:54:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=i8bmEdj4Fp9mTF5mbjxxI1CAVtCsCT5Xo2fWxih6qcM=; b=EwGSmpKrhz6OiTOfoU7Xqa899eWqB+WkINeiKu8nA/N2cxHWNamRBrHgUueFc1xb+r dh6hCZ8kuqhWWq5aIzCMHp9Q0rOXacfZY/Izp4kG9xOFdvNtj5Sme9n7BZX5mWXRV8jS go2o+OL7hjXoEX8Ewi66d/VHbCIp+vbc7OZuZp6KG5cdSEeK+GUD2zwoT6GjlD/bghsc ze7xVDBd1W9AFYULw1oyKNXGKArYT1GybuWb5hz5HSwTKd+9EUzi+vB/QpFIHUERrySL 3RBYYBhPpBIA7OxIzQoEyTHnoyYsIIJ7Wval9hiBdcVhDxDUR+Dn7PdIWHL1N20paakl k47g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=i8bmEdj4Fp9mTF5mbjxxI1CAVtCsCT5Xo2fWxih6qcM=; b=Hi+pOQBpUMziSAXS+kNsffKBojON/vfOyGH0UNLO3vxx/cDf3CrSvwB/dObeSs8jL0 PtnG2pOCQkFtdwEg9spbOTyN2KPQs57ZTy/VVLzpaLZA00Ems93dUmsHaea+8ZRaQMkC f934XEIkwiG7a0NBkOhAa6bJwxG2vBz/Kl2g6WPpM0rezbwX5jJiS9v57UWoGP6Fxp6/ i0HYq1jQ8EgPxkVDfi97vrw4EUIlWjCxJlx63gki1TjMeREC0r9/iOJ0gv6ZoygHHp/Z KyvGc4DUfu7JkFyLc7dUWQqyF3IMNOYEIXXak72gcm4Mw53QMfklBRzJOzTXsIjjBa8p yL6w== X-Gm-Message-State: AOAM5330AU4UH5TxoGUByqBDrvSIz8DA+HGBK649zcRFsoqUDZejKDi2 0Qnqu3AAdcrOuIswmWPfeDjelOaXw/3eWQng X-Google-Smtp-Source: ABdhPJwE98m4xgG6aS/ZT/fnHemGWOHpMVeVh0Z75hCjBI7yySN6gVNI9OwsB9jMQYUNZIIvrmAwPA== X-Received: by 2002:a17:90a:a45:: with SMTP id o63mr4521883pjo.146.1607558042182; Wed, 09 Dec 2020 15:54:02 -0800 (PST) Received: from localhost.localdomain ([192.19.228.250]) by smtp.gmail.com with ESMTPSA id s7sm4047693pfh.207.2020.12.09.15.54.01 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 09 Dec 2020 15:54:01 -0800 (PST) From: Ajit Khaparde X-Google-Original-From: Ajit Khaparde To: dev@dpdk.org Cc: stable@dpdk.org Date: Wed, 9 Dec 2020 15:53:37 -0800 Message-Id: <20201209235347.16180-8-ajit.khaparde@broadcom.com> X-Mailer: git-send-email 2.21.1 (Apple Git-122.3) In-Reply-To: <20201209235347.16180-1-ajit.khaparde@broadcom.com> References: <20201209192233.6518-1-ajit.khaparde@broadcom.com> <20201209235347.16180-1-ajit.khaparde@broadcom.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v3 07/17] net/bnxt: fix cleanup on mutex init failure X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 --- drivers/net/bnxt/bnxt_ethdev.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c index 33358779b..0b14ca234 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) -- 2.21.1 (Apple Git-122.3)