Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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: 14baf4d ("cxl: Add guest-specific code") Reported-by: Dan Carpenter <[email protected]> Signed-off-by: Andrew Donnellan <[email protected]> Signed-off-by: Michael Ellerman <[email protected]>
- Loading branch information