提交 d83d7ed2 编写于 作者: G Greg Kroah-Hartman

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 <tglx@linutronix.de>
Cc: stable <stable@kernel.org>
Reviewed-by: NMarc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20230202151554.2310273-1-gregkh@linuxfoundation.orgSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 6dfb0771
...@@ -1915,7 +1915,7 @@ static void debugfs_add_domain_dir(struct irq_domain *d) ...@@ -1915,7 +1915,7 @@ static void debugfs_add_domain_dir(struct irq_domain *d)
static void debugfs_remove_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) void __init irq_domain_debugfs_init(struct dentry *root)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册