Skip to content
/ linux Public
forked from torvalds/linux

Commit

Permalink
kernel/irq/irqdomain.c: fix memory leak with using debugfs_lookup()
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
gregkh committed Feb 3, 2023
1 parent 6dfb077 commit d83d7ed
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/irq/irqdomain.c
Original file line number Diff line number Diff line change
Expand Up @@ -1915,7 +1915,7 @@ static void debugfs_add_domain_dir(struct irq_domain *d)

static void debugfs_remove_domain_dir(struct irq_domain *d)
{
debugfs_remove(debugfs_lookup(d->name, domain_dir));
debugfs_lookup_and_remove(d->name, domain_dir);
}

void __init irq_domain_debugfs_init(struct dentry *root)
Expand Down

0 comments on commit d83d7ed

Please sign in to comment.