Re: cxl: fix potential NULL dereference in free_adapter()

2016-07-20 Thread Michael Ellerman
On Fri, 2016-15-07 at 07:20:36 UTC, Andrew Donnellan wrote: > 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_adap

[PATCH] cxl: fix potential NULL dereference in free_adapter()

2016-07-15 Thread Andrew Donnellan
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