From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755000AbcHVJ2z (ORCPT ); Mon, 22 Aug 2016 05:28:55 -0400 Received: from terminus.zytor.com ([198.137.202.10]:48228 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753918AbcHVJ2x (ORCPT ); Mon, 22 Aug 2016 05:28:53 -0400 Date: Mon, 22 Aug 2016 02:28:45 -0700 From: tip-bot for Christoph Hellwig Message-ID: Cc: tglx@linutronix.de, linux-kernel@vger.kernel.org, hpa@zytor.com, hch@lst.de, mingo@kernel.org Reply-To: linux-kernel@vger.kernel.org, tglx@linutronix.de, hch@lst.de, mingo@kernel.org, hpa@zytor.com In-Reply-To: <1470924405-25728-1-git-send-email-hch@lst.de> References: <1470924405-25728-1-git-send-email-hch@lst.de> To: linux-tip-commits@vger.kernel.org Subject: [tip:irq/urgent] genirq/affinity: Use get/put_online_cpus around cpumask operations Git-Commit-ID: 3ee0ce2a54dff07d09440723594df89bc1a12e79 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 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 3ee0ce2a54dff07d09440723594df89bc1a12e79 Gitweb: http://git.kernel.org/tip/3ee0ce2a54dff07d09440723594df89bc1a12e79 Author: Christoph Hellwig AuthorDate: Thu, 11 Aug 2016 07:06:45 -0700 Committer: Thomas Gleixner CommitDate: Mon, 22 Aug 2016 11:22:44 +0200 genirq/affinity: Use get/put_online_cpus around cpumask operations Without locking out CPU mask operations we might end up with an inconsistent view of the cpumask in the function. Fixes: 5e385a6ef31f: "genirq: Add a helper to spread an affinity mask for MSI/MSI-X vectors" Signed-off-by: Christoph Hellwig Link: http://lkml.kernel.org/r/1470924405-25728-1-git-send-email-hch@lst.de Signed-off-by: Thomas Gleixner --- kernel/irq/affinity.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/irq/affinity.c b/kernel/irq/affinity.c index f689593..32f6cfc 100644 --- a/kernel/irq/affinity.c +++ b/kernel/irq/affinity.c @@ -39,6 +39,7 @@ struct cpumask *irq_create_affinity_mask(unsigned int *nr_vecs) return NULL; } + get_online_cpus(); if (max_vecs >= num_online_cpus()) { cpumask_copy(affinity_mask, cpu_online_mask); *nr_vecs = num_online_cpus(); @@ -56,6 +57,7 @@ struct cpumask *irq_create_affinity_mask(unsigned int *nr_vecs) } *nr_vecs = vecs; } + put_online_cpus(); return affinity_mask; }