lkml.org 
[lkml]   [2015]   [Jun]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH kernel v12.2] powerpc/powernv: Fix crash when CONFIG_IOMMU_API is off
Date
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 <aik@ozlabs.ru>
---
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


\
 
 \ /
  Last update: 2015-06-11 07:21    [W:0.112 / U:0.092 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site