From: Dave Jiang Date: Thu, 11 Jun 2026 23:03:55 +0000 (-0700) Subject: cxl/test: Unregister cxl_acpi in cxl_test_init() error path X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=50cc34be04a0ea7522b739c9c7a71367cfbc489c;p=thirdparty%2Fkernel%2Flinux.git cxl/test: Unregister cxl_acpi in cxl_test_init() error path In cxl_test_init(), Once cxl_mock_platform_device_add() succeeds, all error paths after needs to call platform_device_unregister() instead of platform_device_put() to clean up. Fixes: 67dcdd4d3b83 ("tools/testing/cxl: Introduce a mocked-up CXL port hierarchy") Reported-by: sashiko-bot Reviewed-by: Alison Schofield Link: https://patch.msgid.link/20260611230355.198912-1-dave.jiang@intel.com Signed-off-by: Dave Jiang --- diff --git a/tools/testing/cxl/test/cxl.c b/tools/testing/cxl/test/cxl.c index 4281d34cd0e74..7351fb87c7ab7 100644 --- a/tools/testing/cxl/test/cxl.c +++ b/tools/testing/cxl/test/cxl.c @@ -1960,7 +1960,7 @@ static __init int cxl_test_init(void) err_mem: cxl_mem_exit(); err_root: - platform_device_put(cxl_acpi); + platform_device_unregister(cxl_acpi); err_rch: cxl_rch_topo_exit(); err_single: