linux-stable/drivers/misc/cxl
Vaibhav Jain 12841f87b7 cxl: Check if vphb exists before iterating over AFU devices
During an eeh a kernel-oops is reported if no vPHB is allocated to the
AFU. This happens as during AFU init, an error in creation of vPHB is
a non-fatal error. Hence afu->phb should always be checked for NULL
before iterating over it for the virtual AFU pci devices.

This patch fixes the kenel-oops by adding a NULL pointer check for
afu->phb before it is dereferenced.

Fixes: 9e8df8a219 ("cxl: EEH support")
Cc: stable@vger.kernel.org # v4.3+
Signed-off-by: Vaibhav Jain <vaibhav@linux.vnet.ibm.com>
Acked-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
Acked-by: Frederic Barrat <fbarrat@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
2017-11-23 23:08:34 +11:00
..
api.c cxl: Enable global TLBIs for cxl contexts 2017-09-28 17:09:16 +10:00
base.c cxl: Add support for interrupts on the Mellanox CX4 2016-07-14 20:27:08 +10:00
context.c cxl: Enable global TLBIs for cxl contexts 2017-09-28 17:09:16 +10:00
cxl.h cxl: Rework the implementation of cxl_stop_trace_psl9() 2017-11-06 16:48:17 +11:00
cxllib.c cxl: Fix memory page not handled 2017-09-29 14:19:44 +10:00
debugfs.c cxl: Rework the implementation of cxl_stop_trace_psl9() 2017-11-06 16:48:17 +11:00
fault.c cxl: Add support for POWER9 DD2 2017-10-06 20:52:43 +11:00
file.c cxl: Enable global TLBIs for cxl contexts 2017-09-28 17:09:16 +10:00
flash.c cxl: Unlock on error in probe 2017-06-06 19:23:52 +10:00
guest.c cxl: Add psl9 specific code 2017-04-13 23:34:31 +10:00
hcalls.c cxl: Remove unused values in bare-metal environment. 2017-04-13 23:34:28 +10:00
hcalls.h
irq.c cxl: Add psl9 specific code 2017-04-13 23:34:31 +10:00
Kconfig cxl: Export library to support IBM XSL 2017-07-03 23:07:03 +10:00
main.c cxl: Fixes for Coherent Accelerator Interface Architecture 2.0 2017-06-23 16:26:23 +10:00
Makefile cxl: Export library to support IBM XSL 2017-07-03 23:07:03 +10:00
native.c cxl: Dump PSL_FIR register on PSL9 error irq 2017-10-13 19:41:57 +11:00
of.c cxl: replace loop with for_each_child_of_node(), remove unneeded of_node_put() 2016-10-04 16:19:23 +11:00
pci.c cxl: Check if vphb exists before iterating over AFU devices 2017-11-23 23:08:34 +11:00
phb.c cxl: Fix error handling in _cxl_pci_associate_default_context() 2016-11-18 22:41:08 +11:00
sysfs.c cxl: Prevent adapter reset if an active context exists 2016-10-19 20:35:39 +11:00
trace.c
trace.h cxl: Add psl9 specific code 2017-04-13 23:34:31 +10:00
vphb.c cxl: fix nested locking hang during EEH hotplug 2017-02-21 21:32:52 +11:00