Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

irq/generic-chip: Don't replace domain's name

When generic irq chips are allocated for an irq domain the domain name is
set to the irq chip name. That was done to have named domains before the
recent changes which enforce domain naming were done.

Since then the overwrite causes a memory leak when the domain name is
dynamically allocated and even worse it would cause the domain free code to
free the wrong name pointer, which might point to a constant.

Remove the name assignment to prevent this.

Fixes: d59f6617eef0 ("genirq: Allow fwnode to carry name information only")
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: stable@vger.kernel.org
Link: https://lkml.kernel.org/r/20170928043731.4764-1-jeffy.chen@rock-chips.com

authored by

Jeffy Chen and committed by
Thomas Gleixner
72364d32 7755d83e

-1
-1
kernel/irq/generic-chip.c
··· 322 322 /* Calc pointer to the next generic chip */ 323 323 tmp += sizeof(*gc) + num_ct * sizeof(struct irq_chip_type); 324 324 } 325 - d->name = name; 326 325 return 0; 327 326 } 328 327 EXPORT_SYMBOL_GPL(__irq_alloc_domain_generic_chips);