Skip to contentSkip to conversation

cxl/test: Unregister cxl_acpi in cxl_test_init() error path

PATCH Applied Dave Jiang 2 participants 3 messages Jun 11 – Jun 12 CXL

lore
Share & tools
lore

Dave Jiang

author maintainer
#0 lore raw

PATCH 1/1 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
---
 tools/testing/cxl/test/cxl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/cxl/test/cxl.c +1 -1
index e6f68dba85d1..5733a526f7dc 100644
@@ -1955,7 +1955,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:

base-commit: 4549871118cf616eecdd2d939f78e3b9e1dddc48
prerequisite-patch-id: 1368e94a3bbc2945c2eb36ac72bd6ab8a10650de

Signature · 1 line
2.54.0
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 3 lines · Dave Jiang

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.

author maintainer Applied
#2 lore raw
In reply to Dave Jiang
Quoted 7 lines · Dave Jiang

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

Applied to cxl/next
50cc34be04a0

Quoted 20 lines
---
 tools/testing/cxl/test/cxl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/cxl/test/cxl.c +1 -1
index e6f68dba85d1..5733a526f7dc 100644
@@ -1955,7 +1955,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:

base-commit: 4549871118cf616eecdd2d939f78e3b9e1dddc48
prerequisite-patch-id: 1368e94a3bbc2945c2eb36ac72bd6ab8a10650de