cxl: Fix NULL pointer dereference on kernel contexts with no AFU interrupts
authorIan Munsie <imunsie@au1.ibm.com>
Wed, 29 Jun 2016 18:55:17 +0000 (04:55 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Fri, 8 Jul 2016 12:13:34 +0000 (22:13 +1000)
commitf5c9df9a442f586b183947627210e167ded81d19
treef9bd0f98948bd5c879aa5c10aa2c41c641be519c
parent2a4f667aadb2d61c289a52a0d6dbc7e4e3aa009f
cxl: Fix NULL pointer dereference on kernel contexts with no AFU interrupts

If a kernel context is initialised and does not have any AFU interrupts
allocated it will cause a NULL pointer dereference when the context is
detached since the irq_names list will not have been initialised.

Move the initialisation of the irq_names list into the cxl_context_init
routine so that it will be valid for the entire lifetime of the context
and will not cause a NULL pointer dereference.

Signed-off-by: Ian Munsie <imunsie@au1.ibm.com>
Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
drivers/misc/cxl/context.c
drivers/misc/cxl/irq.c