Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751054AbbFKEbH (ORCPT ); Thu, 11 Jun 2015 00:31:07 -0400 Received: from e23smtp07.au.ibm.com ([202.81.31.140]:36416 "EHLO e23smtp07.au.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750730AbbFKEbD (ORCPT ); Thu, 11 Jun 2015 00:31:03 -0400 From: Alexey Kardashevskiy To: linuxppc-dev@lists.ozlabs.org Cc: Alexey Kardashevskiy , Benjamin Herrenschmidt , David Gibson , Michael Ellerman , Paul Mackerras , linux-kernel@vger.kernel.org Subject: [PATCH kernel v12.2] powerpc/powernv: Fix crash when CONFIG_IOMMU_API is off Date: Thu, 11 Jun 2015 14:28:41 +1000 Message-Id: <1433996921-23021-1-git-send-email-aik@ozlabs.ru> X-Mailer: git-send-email 2.4.0.rc3.8.gfb3e7d5 In-Reply-To: <20150610073307.948391402AE@ozlabs.org> References: <20150610073307.948391402AE@ozlabs.org> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15061104-0025-0000-0000-000001A3DFAF Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1347 Lines: 39 The code introduced in "[PATCH kernel v12 17/34] powerpc/spapr: vfio: Switch from iommu_table to new iommu_table_group" checks if an IOMMU group was registered for the specific table group which is not true when CONFIG_IOMMU_API is off as iommu_register_group() is a stub in this case. This replaces BUG_ON with WARN_ON and removes the check as it is a wrong place for it anyway. Signed-off-by: Alexey Kardashevskiy --- arch/powerpc/platforms/powernv/pci.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/platforms/powernv/pci.c b/arch/powerpc/platforms/powernv/pci.c index 4b4c583..429498e 100644 --- a/arch/powerpc/platforms/powernv/pci.c +++ b/arch/powerpc/platforms/powernv/pci.c @@ -622,9 +622,8 @@ long pnv_pci_link_table_and_group(int node, int num, { struct iommu_table_group_link *tgl = NULL; - BUG_ON(!tbl); - BUG_ON(!table_group); - BUG_ON(!table_group->group); + if (WARN_ON(!tbl || !table_group)) + return -EINVAL; tgl = kzalloc_node(sizeof(struct iommu_table_group_link), GFP_KERNEL, node); -- 2.4.0.rc3.8.gfb3e7d5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/