Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3604191pxb; Mon, 24 Jan 2022 13:18:48 -0800 (PST) X-Google-Smtp-Source: ABdhPJx6mdVD+D7C8KmDfunaHBD45pw0QJ8yN41ik6fq75/nQHQm1XG1IWe5Ny+bzFJ6Wr/yNRzS X-Received: by 2002:a63:8443:: with SMTP id k64mr8880400pgd.127.1643059128317; Mon, 24 Jan 2022 13:18:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643059128; cv=none; d=google.com; s=arc-20160816; b=UcRN7VM/dtMDCwqSu57UpWqSSMvkuEoUGIdA8JQCsBgo/MmMWtN5Pd1g/CHhZo96F9 JQB2gETATYNcfAZvx+/E99Ralpgm8Hw559/8s/A6emdnSJ1PNo1QCKzoDkwVSv0UDeAy 3EIO2wNJVpCYItOYctFIy9NpapxWmpPb9Y4d4Sy52Mm2QEipsQEGBo3sNBL5FBANbtT+ Beol4pPFqV+SP0zZ9+uGuWRGZ5Vxg55YIHcyTufG45I+Qe6bE++1Rcvuv36KPJekcPQE mEa5qLisqqKjBA+78iYEjDonYi7iaRDZ1UbsgITLP1JJ8Y/rqFmLFmiohAwgXtd+BUkt WtLA== 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=zZGV49OY/Y3DWFg81HILO73pkr4FnGCpe7eJeNNIAW8=; b=JKu1LKSCKmaN8TR8uzKSWfRUq5CqwiSzMhMzBYf9MgfhmwjghLpDn8AdR47183gemd cJkVTT0g2zJYg4u7Ld6M1jHjpN7Nbw41JgNbAVKC7WB1+WWCgsY+tOP6k1fL7onbKc6W EmwYtY0YRCp+gJ5a81dAZvrt3IMvGfV5zpq9pMfI6FR1nZlCqCGAy1s7FsCDGQu2VmUs 9xGt8jkE11FR5SHNAevmHBL8jkCc9Vo7BtX+7M4udovQLsQNn2Ar/55Bb02t4oWuwcrQ vR8C1C/pcOcXxiw6pmr4i+R877zVv+SDQ9Gt2gSFnJKURaFi95Dg+8cvfD6qQVigOulh MlwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=gwDC2TvI; 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 a67si10643882pfb.115.2022.01.24.13.18.27; Mon, 24 Jan 2022 13:18:48 -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=gwDC2TvI; 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 S1442780AbiAXUzO (ORCPT + 99 others); Mon, 24 Jan 2022 15:55:14 -0500 Received: from dfw.source.kernel.org ([139.178.84.217]:58164 "EHLO dfw.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1356873AbiAXUco (ORCPT ); Mon, 24 Jan 2022 15:32:44 -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 01945613FB; Mon, 24 Jan 2022 20:32:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DC227C340E7; Mon, 24 Jan 2022 20:32:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643056363; bh=XofxKjrbwzxrM0OgOkvPQ+yEocd1EQF1xFTdNogLaTc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gwDC2TvITkIeY+tRyx89XzDcJmVR4u7oel4NtxMqpz/EM+EL8q/KvEWhDhQWcUYMF CqFCrrjAvzAh9o4XkMVKy4ifM+JBt7j5GkDVe/HHySbn0/jIez7cwNi5DWbvwG5TU0 k3qsaBKOdhaAHTzjn3pDZo1wAUEHaJW4z76kyyVM= 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.15 459/846] Bluetooth: Fix debugfs entry leak in hci_register_dev() Date: Mon, 24 Jan 2022 19:39:36 +0100 Message-Id: <20220124184116.804534133@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184100.867127425@linuxfoundation.org> References: <20220124184100.867127425@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 325db9c4c6109..53f1b08017aab 100644 --- a/net/bluetooth/hci_core.c +++ b/net/bluetooth/hci_core.c @@ -3999,6 +3999,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