Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3644727pxb; Mon, 24 Jan 2022 14:16:59 -0800 (PST) X-Google-Smtp-Source: ABdhPJzlYtUxoexJm0Imsu/VOMqHkk6Jjh3HvZtmNAxGJz5HJnYww3XZ7KPBFURkHyR+2+fdVxWJ X-Received: by 2002:a17:902:ba8c:b0:14a:f110:84e1 with SMTP id k12-20020a170902ba8c00b0014af11084e1mr16069411pls.7.1643062619499; Mon, 24 Jan 2022 14:16:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643062619; cv=none; d=google.com; s=arc-20160816; b=S59BAR3tSw7rKtAhbSKuFVSe4j6odTTysKU8RNSOTNvCcj3OZN0WP933mzQ3sGAhpj 4Wo9bPcCYZtiV5kfYTgxV8E+0dbcLrIj25Qz9k5V5K+PtJvaGJeeOefqSs5SPtIrUuDU xkO6naSiuOGF2ZbMyxPWwaLa99vUhgQpua77x67NySR5eRzvuK691jneCsSk+0r7vjV3 WiSGKe3f8pxUwAo7sdBv6KQPMf9rTpv39JqmgUde0WKHFjGfo/DTfU9xBb1kO1rK/dy0 /TD6BOCxUrR+Jtv1LLnkGf8pZfkLykzgfukPfKDvpmHezFPSbuKjQSI/SWTgmSPoIa3K u/Yw== 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=7MI/rJ68FDLqZUmpyUrJxt/Tp5oQbdmHOoGOolcinqg=; b=HkDpK2JCsSlHVERHGbUgpJQWBlBf/REdxt5KK2SIilvSs0e6FS5Ea5UsiwvIP1MN9R UeRxDPHqMtxPjxqX+cT9vr4EthBzydfUftppXzS/4HHCH68tcqOlOgc9HrCy65ykYXaB XJcX0+ZIxWdbe+X7CCghwjzXOeBMWkgI+Shq469SxyDwM1LsUxSeAtAVzGjvXLEBuXya BY9j07CCQIeup84lMtNbLaCAZYF4yemzwcHvHF+3pzccBMdrB7k9yz9ApSCTzxbRwxpW WT9W60FsTn0i7GESnf9XlZ0QkvmVMi1fOW9PtZsmzkXBg+TkiflSIzFp4vmlz30hUTcC gk9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="nsyH7H/a"; 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 a133si12747285pfa.60.2022.01.24.14.16.45; Mon, 24 Jan 2022 14:16:59 -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="nsyH7H/a"; 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 S1578146AbiAXWBr (ORCPT + 99 others); Mon, 24 Jan 2022 17:01:47 -0500 Received: from dfw.source.kernel.org ([139.178.84.217]:41660 "EHLO dfw.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1450321AbiAXVUP (ORCPT ); Mon, 24 Jan 2022 16:20:15 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 327D4611C8; Mon, 24 Jan 2022 21:20:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 11F1EC340E4; Mon, 24 Jan 2022 21:20:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643059214; bh=zJJCjk/TJ9AzJOpeI4ISVaIgitdR7n9T84pedxcLQjQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nsyH7H/a3X7V93Mt1+YXFjtPExby1OXgbdB59C9E8fR7Fqvj77vpm81x7pf7dLnro xPUF3WQx5xtg4OzGWENTZsWWVqhfrtFcrMF0ZZLHnf09EKSC25LlKpcEk4JI5wflFw PVDICukPPcaVaSXz05QLG4+sHU+bzyqB81H5dzsQ= 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 5.16 0540/1039] Bluetooth: Fix debugfs entry leak in hci_register_dev() Date: Mon, 24 Jan 2022 19:38:49 +0100 Message-Id: <20220124184143.426234413@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184125.121143506@linuxfoundation.org> References: <20220124184125.121143506@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 2cf77d76c50be..6c00ce302f095 100644 --- a/net/bluetooth/hci_core.c +++ b/net/bluetooth/hci_core.c @@ -3883,6 +3883,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