linux/drivers/misc/cxl
Andrew Donnellan 8fbaa51d43 cxl: fix potential NULL dereference in free_adapter()
If kzalloc() fails when allocating adapter->guest in
cxl_guest_init_adapter(), we call free_adapter() before erroring out.
free_adapter() in turn attempts to dereference adapter->guest, which in
this case is NULL.

In free_adapter(), skip the adapter->guest cleanup if adapter->guest is
NULL.

Fixes: 14baf4d9c7 ("cxl: Add guest-specific code")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
2016-07-19 20:12:29 +10:00
..
api.c cxl: Add support for interrupts on the Mellanox CX4 2016-07-14 20:27:08 +10:00
base.c cxl: Add support for interrupts on the Mellanox CX4 2016-07-14 20:27:08 +10:00
context.c cxl: Workaround PE=0 hardware limitation in Mellanox CX4 2016-07-14 20:28:07 +10:00
cxl.h cxl: Workaround PE=0 hardware limitation in Mellanox CX4 2016-07-14 20:28:07 +10:00
debugfs.c
fault.c
file.c
flash.c
guest.c cxl: fix potential NULL dereference in free_adapter() 2016-07-19 20:12:29 +10:00
hcalls.c
hcalls.h
irq.c
Kconfig cxl: remove dead Kconfig options 2016-07-19 20:12:29 +10:00
main.c cxl: Add support for interrupts on the Mellanox CX4 2016-07-14 20:27:08 +10:00
Makefile cxl: Allow a default context to be associated with an external pci_dev 2016-07-14 20:26:52 +10:00
native.c
of.c
pci.c cxl: Add cxl_check_and_switch_mode() API to switch bi-modal cards 2016-07-14 20:28:11 +10:00
phb.c cxl: Allow a default context to be associated with an external pci_dev 2016-07-14 20:26:52 +10:00
sysfs.c
trace.c
trace.h
vphb.c cxl: Add support for using the kernel API with a real PHB 2016-07-14 20:26:56 +10:00