Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3547955pxb; Mon, 24 Jan 2022 11:58:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJxDE2yLfMPfuAq3lMf3msc3ZHumr/q6D7uzoDdmRf0gKMxsyjz1joYErh4jz8IAdt10Iq+P X-Received: by 2002:a17:902:7d8f:b0:14a:b712:bbfb with SMTP id a15-20020a1709027d8f00b0014ab712bbfbmr15976824plm.63.1643054281344; Mon, 24 Jan 2022 11:58:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643054281; cv=none; d=google.com; s=arc-20160816; b=uj9pljZ7l6NiUeVzQ57RCYdM9m+eDMbnqXYcaPcjjq8IpVDJYPEXsQ/5xSnQg4sB2d SgbGrhPbWsOT/Fn0Lf5ELabvealN8TDrRca/yEAZh0Di1nlzHHNcHApJPzlN127HrQ7k z+uMX+pAKn4d5KOsci0rQTYoBTOz74ycvyGXvkaz8v3DxJ7L97pi3o+NW06PyvbJTeow CfhcLyH2u5+9Jqu5fOs9E1QKkPfoyIFlMd1bcCQr0OuPaCXgH7m+KOpfR3OBRZyrWy7u mJNQIpSCS+sHUTgyC/mxb2pc6E0mdl1qw2eSiK4EIqv+chq91TUzuwZKuXRHe4Y+8Aj5 97rQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=mrS1Ohv6MpI1S24ZuOcsRPl819HDZpeBSHS8f9grmpU=; b=OJuIsfNnEizrrmcnvyNEUk9aB2H2TPdyA4pQphwKLqXOSYVMiBy+EBWG9iYeUsoFe0 7F9lXbnVV5wQISpmPLZBm820/eJtqrUKp0RXjgcKCIugtG4ePEK+qSs2ii9JHo3vQd0S qW9lSIT/p/ub1iej1PdejApatOnmB5OLesy4DRhL5KzKFtCBgokD0eDJdM2TnNP6qGep oVsLLww7zm4GUsnnUD+6Vk1uTIjoX25n3xxkkymmZz+olS4KMCtS+qU5P6BzQTBARwBd q5FK/79QQ7bUly/bFOvXPL++OsRMITT6Gat7swRqm8/fQ+Nbkdwo9pCgWNzKjF2ilsfO Hatw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Gsq8CSzO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id az9si30998plb.510.2022.01.24.11.57.47; Mon, 24 Jan 2022 11:58:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Gsq8CSzO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242515AbiAXSyW (ORCPT + 99 others); Mon, 24 Jan 2022 13:54:22 -0500 Received: from ams.source.kernel.org ([145.40.68.75]:51522 "EHLO ams.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343689AbiAXSwd (ORCPT ); Mon, 24 Jan 2022 13:52:33 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 6E810B81227; Mon, 24 Jan 2022 18:52:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9D143C340E5; Mon, 24 Jan 2022 18:52:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643050351; bh=i5PnfJ5ACF12zxhZM9oXbHuElB0dKR9hdwAK0CLrRJE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Gsq8CSzOSFBF061eTlTuHIkxF5w5Lp0G2WyL1CMAlTjerF1t1x+s5qCXK5tYsHtX3 pW4Hgf7DOb+9quT/uWAcBTrwHsFFu5hzJtt7cQ2xb1VBfpGMCSEbzcSW63BzPNWRvU t2AqLbvH+/2OoquszEMqP4eeoUpDhwKGdd2UKei4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Wei Yongjun , Marcel Holtmann , Sasha Levin Subject: [PATCH 4.4 057/114] Bluetooth: Fix debugfs entry leak in hci_register_dev() Date: Mon, 24 Jan 2022 19:42:32 +0100 Message-Id: <20220124183928.865449135@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124183927.095545464@linuxfoundation.org> References: <20220124183927.095545464@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Wei Yongjun [ Upstream commit 5a4bb6a8e981d3d0d492aa38412ee80b21033177 ] Fault injection test report debugfs entry leak as follows: debugfs: Directory 'hci0' with parent 'bluetooth' already present! When register_pm_notifier() failed in hci_register_dev(), the debugfs create by debugfs_create_dir() do not removed in the error handing path. Add the remove debugfs code to fix it. Signed-off-by: Wei Yongjun Signed-off-by: Marcel Holtmann Signed-off-by: Sasha Levin --- net/bluetooth/hci_core.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c index eefaa10c74dbb..1cc78b88a0d9f 100644 --- a/net/bluetooth/hci_core.c +++ b/net/bluetooth/hci_core.c @@ -3459,6 +3459,7 @@ int hci_register_dev(struct hci_dev *hdev) return id; err_wqueue: + debugfs_remove_recursive(hdev->debugfs); destroy_workqueue(hdev->workqueue); destroy_workqueue(hdev->req_workqueue); err: -- 2.34.1