Commit 9756b15e1b58453a6fd54b85c1ad8515209e10bb
Committed by
Ingo Molnar
1 parent
8fe74cf053
Exists in
master
and in
7 other branches
irq: fix cpumask memory leak on offstack cpumask kernels
Need to free the old cpumask for affinity and pending_mask. Signed-off-by: Yinghai Lu <yinghai@kernel.org> Acked-by: Rusty Russell <rusty@rustcorp.com.au> LKML-Reference: <49D18FF0.50707@kernel.org> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Showing 2 changed files with 15 additions and 0 deletions Side-by-side Diff
include/linux/irq.h
... | ... | @@ -482,6 +482,16 @@ |
482 | 482 | #endif |
483 | 483 | } |
484 | 484 | |
485 | +static inline void free_desc_masks(struct irq_desc *old_desc, | |
486 | + struct irq_desc *new_desc) | |
487 | +{ | |
488 | + free_cpumask_var(old_desc->affinity); | |
489 | + | |
490 | +#ifdef CONFIG_GENERIC_PENDING_IRQ | |
491 | + free_cpumask_var(old_desc->pending_mask); | |
492 | +#endif | |
493 | +} | |
494 | + | |
485 | 495 | #else /* !CONFIG_SMP */ |
486 | 496 | |
487 | 497 | static inline bool init_alloc_desc_masks(struct irq_desc *desc, int cpu, |
... | ... | @@ -495,6 +505,10 @@ |
495 | 505 | { |
496 | 506 | } |
497 | 507 | |
508 | +static inline void free_desc_masks(struct irq_desc *old_desc, | |
509 | + struct irq_desc *new_desc) | |
510 | +{ | |
511 | +} | |
498 | 512 | #endif /* CONFIG_SMP */ |
499 | 513 | |
500 | 514 | #endif /* _LINUX_IRQ_H */ |
kernel/irq/numa_migrate.c