cxl/test: Propagate -ENOMEM on platform_device_alloc() failures

Set rc = -ENOMEM at every platform_device_alloc() failure site in
cxl_rch_topo_init(), cxl_single_topo_init() and cxl_test_init() so the
failure is propagated and the module load aborts cleanly.

The cxl_acpi allocation site originates in the commit below, while the
host-bridge/root-port/uport/dport allocation sites fixed here were added
later in the single-host and RCH topology configs.

Fixes: 67dcdd4d3b ("tools/testing/cxl: Introduce a mocked-up CXL port hierarchy")
Fixes: e41c8452b9 ("tools/testing/cxl: Add a single-port host-bridge regression config")
Fixes: c9435dbee1 ("tools/testing/cxl: Add an RCH topology")
Assisted-by: Claude:claude-opus-4-8
Tested-by: Alison Schofield <alison.schofield@intel.com>
Reviewed-by: Alison Schofield <alison.schofield@intel.com>
Link: https://patch.msgid.link/20260629221104.3891733-6-dave.jiang@intel.com
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
This commit is contained in:
Dave Jiang 2026-06-29 15:11:02 -07:00
commit 98ba41c323