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 55635A09E9; Tue, 8 Dec 2020 21:14:15 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 58179C9E4; Tue, 8 Dec 2020 21:11:56 +0100 (CET) Received: from mail-pf1-f194.google.com (mail-pf1-f194.google.com [209.85.210.194]) by dpdk.org (Postfix) with ESMTP id 4F428C9B0 for ; Tue, 8 Dec 2020 21:11:51 +0100 (CET) Received: by mail-pf1-f194.google.com with SMTP id 11so8725693pfu.4 for ; Tue, 08 Dec 2020 12:11:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version; bh=IbkHCBGMXvKGtVtAwlzKm+Pt/WbTq+Zpbp1F/r+Bfmw=; b=Ia+btYIE6eF58YqeNzqCqghcdaRd5UcTD4cMuascBOv82fCcTu1i9jjYm+jcfAcLwe SwDK3QrbbvqVClXUyQl6dONUTWpJJUiB0nG2/j1KocxHFUXkl7K5YMyors6I4D893Atn BTYTe1XwZSHG/Y4bAFa8h5kkB2H917zbP0HCw= 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; bh=IbkHCBGMXvKGtVtAwlzKm+Pt/WbTq+Zpbp1F/r+Bfmw=; b=a7uOsAKzidotJrhil3W7jpXwaMZFpk2z7PDuMiNfrVgEjzSS9Ae8pJQ09MmMl3y+9Z ZnVBD+Jz5ZlzDYdJybZzkXzQGaihSHhFweU8RzSsq8R5QcIQ8WiXpbS0b1hhYR2LwqA/ l/wFBraAM2Op/Hfx0ZfN8Tr2ZNFfRMKzm646P+Z/7ttL7NY4Wm8+HK8bO/jcdi38sZ+Q QmbDkLcttBHjQ709lSZcJ8Gu2ZYdoeEHTJWrihfOXU6ReI8SyAdjzmz7X5KoHR8Q6hK/ GlQ3ine06RQdjQeM4frtXW1BXkdaTBOcVOHyW5Ua14KYS0nYJpT3oJqppDNScNZUtV70 KMRw== X-Gm-Message-State: AOAM531fSEaDDjo6I/hTF3YTMsXOzo6PhwXoi4jQgTF0HqdI2jvFHJPO ptxo57NuEuLB1m411ccgckivoio6/CikLO0+6sqX2ozhN8SARkgfQMCBTssE8moUU6PEOHrKaIG 9vV2TeNOnY2Ks5oDcdMveNxe700ai4NwLXwFWzd2pOonSuP0FtRJh4taIvLrqVVeVhg== X-Google-Smtp-Source: ABdhPJzirY5WbXQLiFT7AD896DotBF0yvteViHJIRqkbco0agvtdWs9k/JIYD8Jp2IxX1VRjVAMnoQ== X-Received: by 2002:a63:515f:: with SMTP id r31mr23845795pgl.200.1607458309174; Tue, 08 Dec 2020 12:11:49 -0800 (PST) Received: from localhost.localdomain ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id x10sm5729187pfc.157.2020.12.08.12.11.47 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 08 Dec 2020 12:11:48 -0800 (PST) From: Ajit Khaparde To: dev@dpdk.org Cc: stable@dpdk.org Date: Tue, 8 Dec 2020 12:11:24 -0800 Message-Id: <20201208201134.47844-8-ajit.khaparde@broadcom.com> X-Mailer: git-send-email 2.21.1 (Apple Git-122.3) In-Reply-To: <20201208201134.47844-1-ajit.khaparde@broadcom.com> References: <20201208201134.47844-1-ajit.khaparde@broadcom.com> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: [dpdk-dev] [PATCH 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) -- This electronic communication and the information and any files transmitted with it, or attached to it, are confidential and are intended solely for the use of the individual or entity to whom it is addressed and may contain information that is confidential, legally privileged, protected by privacy laws, or otherwise restricted from disclosure to anyone else. If you are not the intended recipient or the person responsible for delivering the e-mail to the intended recipient, you are hereby notified that any use, copying, distributing, dissemination, forwarding, printing, or copying of this e-mail is strictly prohibited. If you received this e-mail in error, please return the e-mail to the sender, delete it from your computer, and destroy any printed copy of it.