This is a note to let you know that I've just added the patch titled drivers: base: component: fix memory leak with using debugfs_lookup() to the 5.15-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: drivers-base-component-fix-memory-leak-with-using-de.patch and it can be found in the queue-5.15 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. commit 1d52f0f8f1f21281400235ffdcab076f6aa28ff1 Author: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> Date: Thu Feb 2 15:16:20 2023 +0100 drivers: base: component: fix memory leak with using debugfs_lookup() [ Upstream commit 8deb87b1e810dd558371e88ffd44339fbef27870 ] When calling debugfs_lookup() the result must have dput() called on it, otherwise the memory will leak over time. To make things simpler, just call debugfs_lookup_and_remove() instead which handles all of the logic at once. Cc: "Rafael J. Wysocki" <rafael@xxxxxxxxxx> Link: https://lore.kernel.org/r/20230202141621.2296458-1-gregkh@xxxxxxxxxxxxxxxxxxx Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx> diff --git a/drivers/base/component.c b/drivers/base/component.c index 870485cbbb87c..058f1a2cb2a9a 100644 --- a/drivers/base/component.c +++ b/drivers/base/component.c @@ -130,7 +130,7 @@ static void component_master_debugfs_add(struct master *m) static void component_master_debugfs_del(struct master *m) { - debugfs_remove(debugfs_lookup(dev_name(m->parent), component_debugfs_dir)); + debugfs_lookup_and_remove(dev_name(m->parent), component_debugfs_dir); } #else