From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754041AbbEMHyr (ORCPT ); Wed, 13 May 2015 03:54:47 -0400 Received: from terminus.zytor.com ([198.137.202.10]:59153 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753235AbbEMHyq (ORCPT ); Wed, 13 May 2015 03:54:46 -0400 Date: Wed, 13 May 2015 00:54:32 -0700 From: tip-bot for Sergey Senozhatsky Message-ID: Cc: sergey.senozhatsky.work@gmail.com, jiang.liu@linux.intel.com, mingo@kernel.org, hpa@zytor.com, linux-kernel@vger.kernel.org, tglx@linutronix.de, sergey.senozhatsky@gmail.com Reply-To: linux-kernel@vger.kernel.org, tglx@linutronix.de, sergey.senozhatsky@gmail.com, sergey.senozhatsky.work@gmail.com, jiang.liu@linux.intel.com, hpa@zytor.com, mingo@kernel.org In-Reply-To: <20150512041444.GA1094@swordfish> References: <20150512041444.GA1094@swordfish> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/apic] x86/hpet: Pass proper pointer to irq_alloc_info Git-Commit-ID: 4a00c95dcdba45c9592af2e908c0816fd54f5544 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: 4a00c95dcdba45c9592af2e908c0816fd54f5544 Gitweb: http://git.kernel.org/tip/4a00c95dcdba45c9592af2e908c0816fd54f5544 Author: Sergey Senozhatsky AuthorDate: Mon, 11 May 2015 18:56:49 +0900 Committer: Thomas Gleixner CommitDate: Wed, 13 May 2015 09:50:24 +0200 x86/hpet: Pass proper pointer to irq_alloc_info Fix the following oops: hpet_msi_get_hwirq+0x1f/0x27 msi_domain_alloc+0x35/0xfe ? trace_hardirqs_on_caller+0x16c/0x188 irq_domain_alloc_irqs_recursive+0x51/0x95 __irq_domain_alloc_irqs+0x151/0x223 hpet_assign_irq+0x5d/0x68 hpet_msi_capability_lookup+0x121/0x1cb ? hpet_enable+0x2b4/0x2b4 hpet_late_init+0x5f/0xf2 ? hpet_enable+0x2b4/0x2b4 do_one_initcall+0x184/0x199 kernel_init_freeable+0x1af/0x237 ? rest_init+0x13a/0x13a kernel_init+0xe/0xd4 ret_from_fork+0x3f/0x70 ? rest_init+0x13a/0x13a Since 3cb96f0c9733 ('x86/hpet: Enhance HPET IRQ to support hierarchical irqdomains') hpet_msi_capability_lookup() uses hpet_assign_irq(). The latter initializes irq_alloc_info on stack, but passes a NULL pointer to irq_domain_alloc_irqs(), which causes a NULL pointer dereference later in hpet_msi_get_hwirq(). Pass the pointer to the irq_alloc_info irq_domain_alloc_irqs(). Fixes: 3cb96f0c9733 'x86/hpet: Enhance HPET IRQ to support hierarchical irqdomains' Signed-off-by: Sergey Senozhatsky Reviewed-by: Jiang Liu Cc: Sergey Senozhatsky Link: http://lkml.kernel.org/r/20150512041444.GA1094@swordfish Signed-off-by: Thomas Gleixner --- arch/x86/kernel/apic/msi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kernel/apic/msi.c b/arch/x86/kernel/apic/msi.c index 58fde66..ef516af 100644 --- a/arch/x86/kernel/apic/msi.c +++ b/arch/x86/kernel/apic/msi.c @@ -351,6 +351,6 @@ int hpet_assign_irq(struct irq_domain *domain, struct hpet_dev *dev, info.hpet_id = hpet_dev_id(domain); info.hpet_index = dev_num; - return irq_domain_alloc_irqs(domain, 1, NUMA_NO_NODE, NULL); + return irq_domain_alloc_irqs(domain, 1, NUMA_NO_NODE, &info); } #endif