Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp2373364lqo; Mon, 20 May 2024 04:02:53 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWdlkIbGDGejCkJHSN6zNTFYSwPpnHEGbVzhFnxTJrW1YVQQwwekG7racMLFWi0XvoTRc0r6UaP0xi20riqzdEOeOOTnCq65HucqBZXWQ== X-Google-Smtp-Source: AGHT+IEXvGBuX9NEU0M04lT9HmnaO41Wp0310MVkISUvM/Oz0r+7MRSmx6Whp8s1XBnBGKMaep/0 X-Received: by 2002:a17:90a:b10e:b0:2b3:6899:b474 with SMTP id 98e67ed59e1d1-2b6cc758f09mr23145149a91.25.1716202973311; Mon, 20 May 2024 04:02:53 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716202973; cv=pass; d=google.com; s=arc-20160816; b=CitaxTYu2ATjLnmLd5Msjx+xIQzziC24pc5NMgRcTsq+MXZylpZmi/zQqytRQ0XB9E I5S9NoM/248s0FzOApNyyeEAGqFxG7DHhf8aQ8fYm236QHa1f4myqMuZVcFGGlA8uq0f gfrvfSpBufL/LQUiEjbRaqxwc2ldW96QtNJNFGSTQrSZdzJfEOH/PQfQW2OeXLE+crZU yHL1/IEfeO9ONXcudT5mMExR0YZp9lDKOYYdPH2oHpssWBhsKsCTPuGZ1AGxzeptzK6Q b2ThXNUZaxu2rw1KuEj804KG7SH6yecn9j2/mM2dPHajcsl/rptJGyk0BQZHM3Lb0FTf 2ZpQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=5U124TlCxdO3CWTYryky3kLV/U0c2UDdWG/vtqiq1NI=; fh=5Ifn1TDVnExruA6hEdOESXuEiC2O9XxEpmYaTmRuMjw=; b=f7pXW1/FkIjeC8WgoYheszlg7ahsBchGwPBhHiXYCtfC8RyiTomw/tdqk0wdRmQMZc NJvuvKa4iTCeRih9+dy/L/ysyWT6McRAPSKGyOsjz1A680DCFvoTuiTI1w7NchqtCWY9 OPMPJXmq80lhY0I9G7sskWFcJePkX3kL3mJMcoFiic8c6+e3M6+h4/rWzaoowFtBzel5 EdOjVrFGS74FvTUn4m/5zks4eK0WZKq1hWgKqlt9bRfoOWTrGzkxTKbKwxb0zk1isEd+ iUOtQ+6mZV7Z/Qxo/CD7SmS8f7Lub+K4MmsSRYEJrnW9Fr0nYcv7Wzgy4/T35cKZXYsn rWHw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Y76dXG6F; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-bluetooth+bounces-4803-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-4803-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 41be03b00d2f7-66d452630dcsi160476a12.892.2024.05.20.04.02.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 May 2024 04:02:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth+bounces-4803-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Y76dXG6F; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-bluetooth+bounces-4803-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-4803-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 9DFB9283167 for ; Mon, 20 May 2024 11:02:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AB11B5380C; Mon, 20 May 2024 11:02:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Y76dXG6F" X-Original-To: linux-bluetooth@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0E6F91643A; Mon, 20 May 2024 11:02:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716202944; cv=none; b=OxmpgkwL6mwBQ+GSEm5W6GhTChOrdtiDj4T6Uj4AnrWy4tbCrXAEsc7vwqdBqZyR8Kul6y6BaBseqVhbd3y2as3epukca/80y0H9LhcqslzLno7CzW9P2Q/y7oEW4Oyigfxe9qI5VC9NXjnZh1//5GJoR6eZm+FxVsM/KJXK+T8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716202944; c=relaxed/simple; bh=fBMRsCfYJyR6hIrSKyh6obRGMiWNwGySypQNPgZYSl4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=GgeiBdN8YJ67UsBqyHCZINrIL2bBbY14hOe3rpEEzF/s0/k5AlpY43/od6CB4oGwh8u1exoDmHD0t+SelWDXboitRSJHE/xZHtib2OW68RD0pbRshkC0m96HblqIOVCeSA8FLwZbMmPVIwdCfsRD2P4EFhNydWlJ92zUVFwyAo4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Y76dXG6F; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id D4CF6C2BD10; Mon, 20 May 2024 11:02:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1716202943; bh=fBMRsCfYJyR6hIrSKyh6obRGMiWNwGySypQNPgZYSl4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Y76dXG6Ff9lU0BseLExi/9Goan23DJwqM6QOWeL9VrauQ1i65KbvD2B7xRGnzJIRV c7iZLWDvaQAi9T46TWXS/chVnyHoRXS1UtoSh+xBXJjokGvwcxb8aN5tkIqakxaZ4m X1RL6xx5vDTWiJ0FnvEwIHgQWPg3Fe0UAtmWImTePIoPF1/805iDB5w0H54KD1+qG8 HgTSoOKYMT6QKZ+78TF6cRznbBFLe1O8DdeskLvn64kLH2d8QQLxPHbJRnkldDQAmA MZ+n+z8GrIkUyvbBAki/9hXnltYr35GW/nUXxy67F3izkKlOeJ/ukglEFNi7HSvAkG hv2boHYgq8JUw== Received: from johan by xi.lan with local (Exim 4.97.1) (envelope-from ) id 1s90mZ-000000003iD-1MbO; Mon, 20 May 2024 13:02:19 +0200 Date: Mon, 20 May 2024 13:02:19 +0200 From: Johan Hovold To: Christophe JAILLET Cc: Marcel Holtmann , Luiz Augusto von Dentz , Tedd Ho-Jeong An , Kiran K , linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Luiz Augusto von Dentz , linux-bluetooth@vger.kernel.org Subject: Re: [PATCH] Bluetooth: btintel_pcie: Fix the error handling path of btintel_pcie_probe() Message-ID: References: <692b4749f4267436363a5a8840140da8cd8858a1.1716190895.git.christophe.jaillet@wanadoo.fr> Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <692b4749f4267436363a5a8840140da8cd8858a1.1716190895.git.christophe.jaillet@wanadoo.fr> On Mon, May 20, 2024 at 09:41:57AM +0200, Christophe JAILLET wrote: > Some resources freed in the remove function are not handled by the error > handling path of the probe. > > Add the needed function calls. > > Fixes: c2b636b3f788 ("Bluetooth: btintel_pcie: Add support for PCIe transport") > Signed-off-by: Christophe JAILLET > --- > Compile tested only. > Maybe incomplete. > --- > drivers/bluetooth/btintel_pcie.c | 20 ++++++++++++++------ > 1 file changed, 14 insertions(+), 6 deletions(-) > > diff --git a/drivers/bluetooth/btintel_pcie.c b/drivers/bluetooth/btintel_pcie.c > index 5b6805d87fcf..d572576d0dbc 100644 > --- a/drivers/bluetooth/btintel_pcie.c > +++ b/drivers/bluetooth/btintel_pcie.c > @@ -1280,17 +1280,17 @@ static int btintel_pcie_probe(struct pci_dev *pdev, > > err = btintel_pcie_config_pcie(pdev, data); > if (err) > - goto exit_error; > + goto exit_destroy_worqueue; typo: workqueue [...] > bt_dev_dbg(data->hdev, "cnvi: 0x%8.8x cnvr: 0x%8.8x", data->cnvi, > data->cnvr); > return 0; > > -exit_error: > +exit_free_pcie: > + btintel_pcie_free(data); > + > +exit_free_irq_vectors: > + pci_free_irq_vectors(pdev); > + > +exit_destroy_worqueue: > + destroy_workqueue(data->workqueue); > + Please use an 'err_' prefix which is shorter and clearly indicates that these are error paths. I'd also drop the newlines. > /* reset device before exit */ > btintel_pcie_reset_bt(data); Johan