Skip to content

Commit d83d7ed

Browse files
committed
kernel/irq/irqdomain.c: 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. Cc: Thomas Gleixner <[email protected]> Cc: stable <[email protected]> Reviewed-by: Marc Zyngier <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 6dfb077 commit d83d7ed

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/irq/irqdomain.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1915,7 +1915,7 @@ static void debugfs_add_domain_dir(struct irq_domain *d)
19151915

19161916
static void debugfs_remove_domain_dir(struct irq_domain *d)
19171917
{
1918-
debugfs_remove(debugfs_lookup(d->name, domain_dir));
1918+
debugfs_lookup_and_remove(d->name, domain_dir);
19191919
}
19201920

19211921
void __init irq_domain_debugfs_init(struct dentry *root)

0 commit comments

Comments
 (0)