Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3551312pxb; Mon, 24 Jan 2022 12:02:31 -0800 (PST) X-Google-Smtp-Source: ABdhPJxj9UxnhRhgntPEZwO65eYvhItAhZQL3K/4CBI2QU39Vu47IDiiEJJOSH4SgeKZIK/ot3s2 X-Received: by 2002:a05:6a00:1d26:b0:4c0:2388:73c6 with SMTP id a38-20020a056a001d2600b004c0238873c6mr15387060pfx.69.1643054551453; Mon, 24 Jan 2022 12:02:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643054551; cv=none; d=google.com; s=arc-20160816; b=0TafEkPgQS5z65SswO+TlJFgYUFm3JIMuicWTZvBg+iXFIX8esuBGNR4WMUS4ID1Qi +WnIGcHNEAB0mzhoS0uLSk5xjTJearb+EgTppD1TRnxjSFFhR7DJBizDFAiC0PJcLAmY zSTMLK66mcLStz3Gv0SHcY+X0/mntlZxxXUaUhWCSILRetD8RqmABYI7EsxoEy500iZv D+lIFxqTz0IBvE0+PNWPLfHq7PlH5WsqKBOsPPGZDGhW5PzUIkWNSBzpn5pfjGhWM9ou /NL6QsFVTpnA+clYCAJuuPqxVIuXIJieUCODMJrxmzzVeEgliaQRHqdk3eOOkg1w13ND qWWw== 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=p+NHH4urUxKWFSL6BpdEvtK5MNHiAVMIklDIxF8xQl4=; b=JXffTqgxizv2zyG0OwPTnn4kWFYnW+Goxdjwn8eQmbsEpqgT7v3Ebd8kRBg3LPYgkZ wk3boj8YrZ+SR74RQMDze3tiQTAe6gygQ5N4VIBiIdhDM8jgSq2Xm5ZcIULuos89abj5 UmS7nq9O52N/ioPu99gLv1rPKxaxHH2YPirwOSrUPxBppF9471yrIQAAKxQkgzQWDXas ho4HbC9dU1lkyXhTlkT2OuUR7rSaX34QVdZmfNRDcWkMAGOVOfEr3CRNJt1GSmzdBZEi z5HxWIp27K59coRauT9Dl73Q9CmCbvaGyBJqnfy9V4qh+GRiVptbMnXVTK9atag+bd+d NA7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=zYd5Bvls; 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 l193si4416638pge.764.2022.01.24.12.02.14; Mon, 24 Jan 2022 12:02:31 -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=zYd5Bvls; 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 S1344635AbiAXTBr (ORCPT + 99 others); Mon, 24 Jan 2022 14:01:47 -0500 Received: from ams.source.kernel.org ([145.40.68.75]:55618 "EHLO ams.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343518AbiAXS5t (ORCPT ); Mon, 24 Jan 2022 13:57:49 -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 09CC5B8121C; Mon, 24 Jan 2022 18:57:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2DF25C340E5; Mon, 24 Jan 2022 18:57:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643050666; bh=8HhqhLYUtzscszQjAX1dCUydahnbhPvnAe7pYo2zT+Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zYd5Bvls/YEUFsQUt3AK+YZrMqvsifYgAWqP3YEYKCLIIZBjl4Xt7C61vzSbRDL/M oLKHITcHGOKlILK4sbbiO6O1BEnAFq0ysFNhfpczQLBMmfBHlco6mQU0PvSoMhjX/g cKc7gFFq2NROdJo5N++c8yGJ8FRG2NksbP72HjHI= 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.9 073/157] Bluetooth: Fix debugfs entry leak in hci_register_dev() Date: Mon, 24 Jan 2022 19:42:43 +0100 Message-Id: <20220124183935.107317641@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124183932.787526760@linuxfoundation.org> References: <20220124183932.787526760@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 b43f31203a430..40e6e5feb1e06 100644 --- a/net/bluetooth/hci_core.c +++ b/net/bluetooth/hci_core.c @@ -3148,6 +3148,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