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 2C56FA04DB; Wed, 9 Dec 2020 20:24:45 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E6686C9D3; Wed, 9 Dec 2020 20:22:54 +0100 (CET) Received: from mail-pf1-f196.google.com (mail-pf1-f196.google.com [209.85.210.196]) by dpdk.org (Postfix) with ESMTP id D8CC5C9B0; Wed, 9 Dec 2020 20:22:49 +0100 (CET) Received: by mail-pf1-f196.google.com with SMTP id 131so1659902pfb.9; Wed, 09 Dec 2020 11:22:49 -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=VcoboncwmibzeR013BMYyFAGLi+4WcSECz+vZ861UDqgnfCfmGfDQXEvDLL8ROH1dh CmVjEpgxdi6KAdFxaP09JTA4T/EyUNH0XTDQQdb+zXGeGgnQ0s3NS+vd87iA8Fj4rGKM AICHdKQTHXUaRIhQuNDQ+7iyX9cXIjoP/AqcP/schkYYCzngVcwQCKzWpOYshqtGfl+Z 7NUMLLDn0xgj5r3dcKsaeFSYsE8/yct5iroAmRByDUrXqqPdihu8OOkiIwI69H6DUZjn DAyCmpnuucpDSf4kb/40EM6FxsKift+BE3CkQRluPBRRA57NqQZOUbuMU/cBf0Efr/wd RKgA== 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=SCj9n2NIptyurbtkCjmCmeP0X6SFlhVU8cG9Q6H8ntGtd83raJcfAkcVRR4lulPl90 m5YERzGviZzR8ur5cFlwWrG8iSWP4Y/laSftzh+zz4elimTZ49O21v+nFnEemCou4gny +BjhC/pngU/wl66QwD6oqdmiZdiX5fORhmRyZzzuPxFTnOIbiDjkeLWc5Tl0ptlb6Aad pUPj8RLkPvL2vuO2fSHqm9XaXSbSbjmls9zkIpAiD2is3kNx0ziAt1YVLvx8qHBftXbl JuorAey4Mi0mq8gnXyClyWMHeAKABDSNHvSA7HNBiThZFHCPmsNDI5o/TtsV465S/EUj HosQ== X-Gm-Message-State: AOAM531Y38QwIEoH2w9wTU1dRSc4eAp7bzEb1hB5Qhpq7xxjmo0k8pms pCuvJCgH+wp8gmtiPV4PfuX2G/NmuKLyE8+/ X-Google-Smtp-Source: ABdhPJzNYw784GAraNfUJlVbzAfqnpJ+jbUQvUXGQRerJVt4xPmeFuLOWvx8owQzUyHqtV4TniRNdQ== X-Received: by 2002:aa7:9dc7:0:b029:19b:178f:84d7 with SMTP id g7-20020aa79dc70000b029019b178f84d7mr3463808pfq.70.1607541767885; Wed, 09 Dec 2020 11:22:47 -0800 (PST) Received: from localhost.localdomain ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id y1sm3342449pfe.80.2020.12.09.11.22.46 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 09 Dec 2020 11:22:47 -0800 (PST) From: Ajit Khaparde X-Google-Original-From: Ajit Khaparde To: dev@dpdk.org Cc: stable@dpdk.org Date: Wed, 9 Dec 2020 11:22:23 -0800 Message-Id: <20201209192233.6518-8-ajit.khaparde@broadcom.com> X-Mailer: git-send-email 2.21.1 (Apple Git-122.3) In-Reply-To: <20201209192233.6518-1-ajit.khaparde@broadcom.com> References: <20201209192233.6518-1-ajit.khaparde@broadcom.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v2 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)