Re: [PATCH] irq/generic-chip: Fix memory leak of domain->name

2017-09-27 Thread jeffy
Hi Thomas, On 09/28/2017 11:18 AM, jeffy wrote: I don't think that this is the proper thing to do. There is no reason why the domain should have the same name as the irq chip. So we rather should do: if (!d->name) d->name = name; Along with a proper comment. that is better, will

Re: [PATCH] irq/generic-chip: Fix memory leak of domain->name

2017-09-27 Thread jeffy
Hi Thomas, Thanks for your review. On 09/27/2017 09:29 PM, Thomas Gleixner wrote: On Wed, 27 Sep 2017, Jeffy Chen wrote: Free domain->name when IRQ_DOMAIN_NAME_ALLOCATED been set. I can see that from the patch, but you fail to explain what the problem is. It's actually more than just a mem

Re: [PATCH] irq/generic-chip: Fix memory leak of domain->name

2017-09-27 Thread Thomas Gleixner
On Wed, 27 Sep 2017, Jeffy Chen wrote: > Free domain->name when IRQ_DOMAIN_NAME_ALLOCATED been set. I can see that from the patch, but you fail to explain what the problem is. It's actually more than just a memory leak. If the domain gets destroyed then the domain free code would try to free d->

[PATCH] irq/generic-chip: Fix memory leak of domain->name

2017-09-27 Thread Jeffy Chen
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 --- kernel/irq/generic-chip.c | 4 1 file changed, 4 insertions(+) diff --git a/kernel/irq/generic-chip.c b/kernel/irq/generic-c