Skip to content

Commit ca76a3a

Browse files
committed
cxl/pci: Fix NULL vs ERR_PTR confusion
cxl_pci_map_regblock() may return an ERR_PTR(), but cxl_pci_setup_regs() is only prepared for NULL as the error case. Pick the minimal fix for -stable backport purposes and just have cxl_pci_map_regblock() return NULL for errors. Fixes: f8a7e8c ("cxl/pci: Reserve all device regions at once") Cc: <[email protected]> Reviewed-by: Ira Weiny <[email protected]> Reviewed-by: Jonathan Cameron <[email protected]> Link: https://lore.kernel.org/r/163433325724.834522.17809774578178224149.stgit@dwillia2-desk3.amr.corp.intel.com Signed-off-by: Dan Williams <[email protected]>
1 parent d22fed9 commit ca76a3a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/cxl/pci.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ static void __iomem *cxl_pci_map_regblock(struct cxl_mem *cxlm,
317317
if (pci_resource_len(pdev, bar) < offset) {
318318
dev_err(dev, "BAR%d: %pr: too small (offset: %#llx)\n", bar,
319319
&pdev->resource[bar], (unsigned long long)offset);
320-
return IOMEM_ERR_PTR(-ENXIO);
320+
return NULL;
321321
}
322322

323323
addr = pci_iomap(pdev, bar, 0);

0 commit comments

Comments
 (0)