Skip to content
Commit e6e17cc6 authored by Dan Williams's avatar Dan Williams
Browse files

cxl/core: Fix cxl_device_lock() class detection

If cxl_device_lock() is used on a non-CXL device the expectation is that
the lock class will fall back to CXL_ANON_LOCK. Instead it crashes when
trying to determine if the device is a 'decoder'. Specifically when the
device has a NULL type pointer. Just check for NULL before
de-referencing ->release.

Fixes: 3c5b9039

 ("cxl: Prove CXL locking")
Reported-by: default avatarBen Widawsky <ben.widawsky@intel.com>
Reviewed-by: default avatarBen Widawsky <ben.widawsky@intel.com>
Link: https://lore.kernel.org/r/164439225406.2941117.3927102269866914339.stgit@dwillia2-desk3.amr.corp.intel.com
Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
parent 5c3c067b
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment