Skip to content

Commit

Permalink
genirq/irqdesc: Fix double increment in alloc_descs()
Browse files Browse the repository at this point in the history
The recent rework of alloc_descs() introduced a double increment of the
loop counter. As a consequence only every second affinity mask is
validated.

Remove it.

[ tglx: Massaged changelog ]

Fixes: c410abb ("genirq/affinity: Add is_managed to struct irq_affinity_desc")
Signed-off-by: Huacai Chen <chenhc@lemote.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Fuxin Zhang <zhangfx@lemote.com>
Cc: Zhangjin Wu <wuzhangjin@gmail.com>
Cc: Huacai Chen <chenhuacai@gmail.com>
Cc: Dou Liyang <douliyangs@gmail.com>
Link: https://lkml.kernel.org/r/1547694009-16261-1-git-send-email-chenhc@lemote.com
  • Loading branch information
Huacai Chen authored and Thomas Gleixner committed Jan 17, 2019
1 parent 70921ae commit 12fee4c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/irq/irqdesc.c
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ static int alloc_descs(unsigned int start, unsigned int cnt, int node,

/* Validate affinity mask(s) */
if (affinity) {
for (i = 0; i < cnt; i++, i++) {
for (i = 0; i < cnt; i++) {
if (cpumask_empty(&affinity[i].mask))
return -EINVAL;
}
Expand Down

0 comments on commit 12fee4c

Please sign in to comment.