Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3560859pxb; Mon, 24 Jan 2022 12:14:38 -0800 (PST) X-Google-Smtp-Source: ABdhPJwqgRX71IWaVrvsDXdiwYunWhWZDr730ZEWMNMDE4bwUorhSuDvpS8NIuBpuPAna9wWiT2T X-Received: by 2002:a63:6e45:: with SMTP id j66mr5912773pgc.81.1643055278157; Mon, 24 Jan 2022 12:14:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643055278; cv=none; d=google.com; s=arc-20160816; b=kjBwmNJ26jMYQVeh/rjynu0+USmFKqnjqr8rzUrHpsfQHJsHaMoZj1A1b4Ek/Mx4H4 OCDJvg5pdI2q0aIgxWHHTxdPVMr6BsDndIW+EaVpqiBcd/2m3S0qTKlZW2XbnITjUkRM VdeMFAQlL+9IFVbMzrPdT6l3GUwFUn7r0bbRryxXyZwNQ1/0lgH2lAzca5Cv4Ov36UwD Dt6Xvs0AaWei2mJENGsjLqkTdI5l3Bhrery/jcQfUFM4gnOXDSTDTq0bl94hzsk1S+AN jeOpZ06Z7CTTCNUNPw6FmpyN5lDrl0nKRyhyzajhXCiWDB5QPNAeRJH8OU4z5CyRgqcO MqZQ== 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=FvSm7z8guio0DXm6WfLu2lLiP9SslNNDgF2viyVtX9I=; b=FBFEObxOs6FBJTCMDrLHBVaam3Iza0o+RgNEW36ulZ0Fozpz2YfcBJY0sn61zlnDxC SRG9SoHRAAZACadq/HqhhFaFb0Ae4Lvb8oJdheg/Iz6SS2a0RhoYyf6jVUHXvwjaoeQM XzVP+CU3TlfCqajEL3SZaL9P1QozrwWbeBa/zB4K578WgeFxsPycwo0pRll6v4F9/X3P aUbMMzjnyxYvh8J0wM/PUp+V69TbNaqKgN+2ptmBi0wBCuFbmH7MsVTq1Sj0mp77m09h ygvA/6VR3jhkGusntLEi1aEH27NGLGEFbsSnzd8AdZzbWcBhq15pzbHVsVRKl6egIG6q 3KxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=pBsBpRwJ; 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 p5si944532pgj.499.2022.01.24.12.14.25; Mon, 24 Jan 2022 12:14:38 -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=pBsBpRwJ; 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 S243050AbiAXTRe (ORCPT + 99 others); Mon, 24 Jan 2022 14:17:34 -0500 Received: from dfw.source.kernel.org ([139.178.84.217]:36572 "EHLO dfw.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345884AbiAXTGk (ORCPT ); Mon, 24 Jan 2022 14:06:40 -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 16EB0611DA; Mon, 24 Jan 2022 19:06:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CD784C340E5; Mon, 24 Jan 2022 19:06:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643051197; bh=Sh+M3L0lB9KpZ1YUcJstaGMEojTqMlUaXuswNPJ9dYg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pBsBpRwJde5Gu4jGiFC6DzHgiPOPkFMlYspxUf2obor0F5oOL1PPCnDWuqI3iKMG3 C854UMPjLfBRk9kz3QWMxXRXkgBf8U3ZFxui3tL6DGjvelIOjN1vCbOq6MDHWLwC49 bavDU/9/7i2h203uzEJmhuFSmKrj1914cN0lJfg4= 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.14 086/186] Bluetooth: Fix debugfs entry leak in hci_register_dev() Date: Mon, 24 Jan 2022 19:42:41 +0100 Message-Id: <20220124183939.880661017@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124183937.101330125@linuxfoundation.org> References: <20220124183937.101330125@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 1906adfd553ad..687b4d0e4c673 100644 --- a/net/bluetooth/hci_core.c +++ b/net/bluetooth/hci_core.c @@ -3183,6 +3183,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