public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: tip-bot for Huacai Chen <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: hpa@zytor.com, chenhc@lemote.com, zhangfx@lemote.com,
	douliyangs@gmail.com, tglx@linutronix.de, wuzhangjin@gmail.com,
	chenhuacai@gmail.com, linux-kernel@vger.kernel.org,
	mingo@kernel.org
Subject: [tip:irq/urgent] genirq/irqdesc: Fix double increment in alloc_descs()
Date: Thu, 17 Jan 2019 15:45:56 -0800	[thread overview]
Message-ID: <tip-12fee4cd5be2c4a73cc13d7ad76eb2d2feda8a71@git.kernel.org> (raw)
In-Reply-To: <1547694009-16261-1-git-send-email-chenhc@lemote.com>

Commit-ID:  12fee4cd5be2c4a73cc13d7ad76eb2d2feda8a71
Gitweb:     https://git.kernel.org/tip/12fee4cd5be2c4a73cc13d7ad76eb2d2feda8a71
Author:     Huacai Chen <chenhc@lemote.com>
AuthorDate: Thu, 17 Jan 2019 11:00:09 +0800
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Fri, 18 Jan 2019 00:43:09 +0100

genirq/irqdesc: Fix double increment in alloc_descs()

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: c410abbbacb9 ("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

---
 kernel/irq/irqdesc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/irq/irqdesc.c b/kernel/irq/irqdesc.c
index ee062b7939d3..ef8ad36cadcf 100644
--- a/kernel/irq/irqdesc.c
+++ b/kernel/irq/irqdesc.c
@@ -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;
 		}

      reply	other threads:[~2019-01-17 23:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-17  3:00 [PATCH] genirq/irqdesc: Fix a bug in alloc_descs() Huacai Chen
2019-01-17 23:45 ` tip-bot for Huacai Chen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tip-12fee4cd5be2c4a73cc13d7ad76eb2d2feda8a71@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=chenhc@lemote.com \
    --cc=chenhuacai@gmail.com \
    --cc=douliyangs@gmail.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=wuzhangjin@gmail.com \
    --cc=zhangfx@lemote.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox