[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20170927122816.18931-1-jeffy.chen@rock-chips.com>
Date: Wed, 27 Sep 2017 20:28:16 +0800
From: Jeffy Chen <jeffy.chen@...k-chips.com>
To: linux-kernel@...r.kernel.org
Cc: Jeffy Chen <jeffy.chen@...k-chips.com>,
Thomas Gleixner <tglx@...utronix.de>
Subject: [PATCH] irq/generic-chip: Fix memory leak of domain->name
Free domain->name when IRQ_DOMAIN_NAME_ALLOCATED been set.
Fixes: d59f6617eef0 ("genirq: Allow fwnode to carry name information only")
Signed-off-by: Jeffy Chen <jeffy.chen@...k-chips.com>
---
kernel/irq/generic-chip.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/kernel/irq/generic-chip.c b/kernel/irq/generic-chip.c
index f7086b78ad6e..174dae8ee7fe 100644
--- a/kernel/irq/generic-chip.c
+++ b/kernel/irq/generic-chip.c
@@ -322,6 +322,10 @@ int __irq_alloc_domain_generic_chips(struct irq_domain *d, int irqs_per_chip,
/* Calc pointer to the next generic chip */
tmp += sizeof(*gc) + num_ct * sizeof(struct irq_chip_type);
}
+ if (d->flags & IRQ_DOMAIN_NAME_ALLOCATED) {
+ kfree(d->name);
+ d->flags &= ~IRQ_DOMAIN_NAME_ALLOCATED;
+ }
d->name = name;
return 0;
}
--
2.11.0
Powered by blists - more mailing lists