Skip to content

Commit 5b268d8

Browse files
gregkhKAGA-KOKO
authored andcommitted
time/debug: Fix memory leak with using debugfs_lookup()
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. Signed-off-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 915d4ad commit 5b268d8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/time/test_udelay.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ module_init(udelay_test_init);
149149
static void __exit udelay_test_exit(void)
150150
{
151151
mutex_lock(&udelay_test_lock);
152-
debugfs_remove(debugfs_lookup(DEBUGFS_FILENAME, NULL));
152+
debugfs_lookup_and_remove(DEBUGFS_FILENAME, NULL);
153153
mutex_unlock(&udelay_test_lock);
154154
}
155155

0 commit comments

Comments
 (0)