Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2505602imu; Thu, 17 Jan 2019 15:48:03 -0800 (PST) X-Google-Smtp-Source: ALg8bN7QO8T+qdaKz1aS/5lRJ1ZLpbKkCgLSJbQUsPbKfYO+1rHMYwDeJTOiODy2GsaPfWZLbEgN X-Received: by 2002:a62:b15:: with SMTP id t21mr17518050pfi.136.1547768883754; Thu, 17 Jan 2019 15:48:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547768883; cv=none; d=google.com; s=arc-20160816; b=DwtkH9QQXaq6No7sO+0bDP2ihwBjefi3S3gJmHmrsVw2frXDQ0oq8d0nbuHFw+S/b3 A2QVOSOZUFWviktCguRJCkrCTG92J9C9WK2+y44RXrDvzg97HcfVFsKDlGWj5I4Q+lnQ 04Ukzi0GZCG3cQ015xMF1n1RossHrqIkCTkaGfqubzY00dZcvwwHi34EnFLwFwwt8iA4 3wYS8z/z0M4iwTP3eWyGQow2WM5IlDpmfS3XJCM2e6pCuMhs0KGEanbJ0iXkvWYMb8DL 1XlM4OhACCaG0Wun1Cx3ya5H84IUft3UEqE6+66KCxdYdewZFrZ6ky8OnntnYiQoAVQC Q+QA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date; bh=geBW4vTYpze/zq9gWxtl71XGHYTDPpcANbnsdgQrGZE=; b=zjcjCvTc984rqytgyQSNYq0wnOjiTaLZKkWgJcI1sfFNY9sZZxaXb6xzibjs7Y5Sn4 rp4hK7N3naeQIx0UxV4zdbEW63xkLlImnnRrzsCLS2ROiKZ5L9HdJYpss+2qqOVuk8eH q5sVZ4OR0K+SzFpoCHeu8QfPdLCYbyqhFHsrdRd5DWE0te20c+2W7x1T+NbfZQH2pv2z RulAKaeKns76sC/VwdanrkPPNRbRI0DEAQZ7SkHYuusIx++qa4lcWNPKos2KKrK4kstJ gpydp8Eg+8Zaxls0VxO5ba5Agf/NSqeoOmeWrj+8gVYe+22zS9/Q+Zp2GOLR7IzQfr8z KnJA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 135si2862079pge.572.2019.01.17.15.47.47; Thu, 17 Jan 2019 15:48:03 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727186AbfAQXqO (ORCPT + 99 others); Thu, 17 Jan 2019 18:46:14 -0500 Received: from terminus.zytor.com ([198.137.202.136]:46153 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726919AbfAQXqO (ORCPT ); Thu, 17 Jan 2019 18:46:14 -0500 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTPS id x0HNjvRN948900 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Thu, 17 Jan 2019 15:45:57 -0800 Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id x0HNjugh948895; Thu, 17 Jan 2019 15:45:56 -0800 Date: Thu, 17 Jan 2019 15:45:56 -0800 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Huacai Chen Message-ID: 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 Reply-To: chenhuacai@gmail.com, wuzhangjin@gmail.com, tglx@linutronix.de, mingo@kernel.org, linux-kernel@vger.kernel.org, chenhc@lemote.com, hpa@zytor.com, zhangfx@lemote.com, douliyangs@gmail.com In-Reply-To: <1547694009-16261-1-git-send-email-chenhc@lemote.com> References: <1547694009-16261-1-git-send-email-chenhc@lemote.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:irq/urgent] genirq/irqdesc: Fix double increment in alloc_descs() Git-Commit-ID: 12fee4cd5be2c4a73cc13d7ad76eb2d2feda8a71 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Spam-Status: No, score=1.4 required=5.0 tests=ALL_TRUSTED,BAYES_00, DATE_IN_FUTURE_48_96,FREEMAIL_FORGED_REPLYTO autolearn=no autolearn_force=no version=3.4.2 X-Spam-Level: * X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 12fee4cd5be2c4a73cc13d7ad76eb2d2feda8a71 Gitweb: https://git.kernel.org/tip/12fee4cd5be2c4a73cc13d7ad76eb2d2feda8a71 Author: Huacai Chen AuthorDate: Thu, 17 Jan 2019 11:00:09 +0800 Committer: Thomas Gleixner 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 Signed-off-by: Thomas Gleixner Cc: Fuxin Zhang Cc: Zhangjin Wu Cc: Huacai Chen Cc: Dou Liyang 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; }