Commit 69d56b15 authored by Dan Carpenter's avatar Dan Carpenter Committed by Dan Williams

cxl/hdm: Fix && vs || bug

If "info" is NULL then this code will crash.  || was intended instead of
&&.

Fixes: 8ce520fd ("cxl/hdm: Use stored Component Register mappings to map HDM decoder capability")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: default avatarRobert Richter <rrichter@amd.com>
Link: https://lore.kernel.org/r/60028378-d3d5-4d6d-90fd-f915f061e731@moroto.mountainSigned-off-by: default avatarDan Williams <dan.j.williams@intel.com>
parent b3cfdbf6
......@@ -146,7 +146,7 @@ struct cxl_hdm *devm_cxl_setup_hdm(struct cxl_port *port,
/* Memory devices can configure device HDM using DVSEC range regs. */
if (reg_map->resource == CXL_RESOURCE_NONE) {
if (!info && !info->mem_enabled) {
if (!info || !info->mem_enabled) {
dev_err(dev, "No component registers mapped\n");
return ERR_PTR(-ENXIO);
}
......
Markdown is supported
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