Skip to content

Commit

Permalink
irq/generic-chip: Don't replace domain's name
Browse files Browse the repository at this point in the history
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: d59f661 ("genirq: Allow fwnode to carry name information only")
Signed-off-by: Jeffy Chen <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
Cc: [email protected]
Link: https://lkml.kernel.org/r/[email protected]
  • Loading branch information
JeffyCN authored and KAGA-KOKO committed Sep 28, 2017
1 parent 7755d83 commit 72364d3
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion kernel/irq/generic-chip.c
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,6 @@ 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);
}
d->name = name;
return 0;
}
EXPORT_SYMBOL_GPL(__irq_alloc_domain_generic_chips);
Expand Down

0 comments on commit 72364d3

Please sign in to comment.