Skip to content

Commit 69d56b1

Browse files
Dan Carpenterdjbw
authored andcommitted
cxl/hdm: Fix && vs || bug
If "info" is NULL then this code will crash. || was intended instead of &&. Fixes: 8ce520f ("cxl/hdm: Use stored Component Register mappings to map HDM decoder capability") Signed-off-by: Dan Carpenter <[email protected]> Reviewed-by: Robert Richter <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Dan Williams <[email protected]>
1 parent b3cfdbf commit 69d56b1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/cxl/core/hdm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ struct cxl_hdm *devm_cxl_setup_hdm(struct cxl_port *port,
146146

147147
/* Memory devices can configure device HDM using DVSEC range regs. */
148148
if (reg_map->resource == CXL_RESOURCE_NONE) {
149-
if (!info && !info->mem_enabled) {
149+
if (!info || !info->mem_enabled) {
150150
dev_err(dev, "No component registers mapped\n");
151151
return ERR_PTR(-ENXIO);
152152
}

0 commit comments

Comments
 (0)