diff options
| author | Alex Hung <alex.hung@amd.com> | 2026-09-10 10:28:11 -0600 |
|---|---|---|
| committer | Alex Deucher <alexander.deucher@amd.com> | 2026-09-23 13:46:06 -0400 |
| commit | 846b74b1bd1200e4940c166bcd5835e60929a723 (patch) | |
| tree | 7fa847f061fa3094b257ea4c60f2a51b8c71c8d4 /drivers/gpu/drm | |
| parent | 400b1961051f3fe3706677b44c53605526b04bc7 (diff) | |
| download | linux-next-846b74b1bd1200e4940c166bcd5835e60929a723.tar.gz linux-next-846b74b1bd1200e4940c166bcd5835e60929a723.zip | |
drm/amd/display: Fix KUnit MST warnings
[WHY]
The MST add-connector fixture registers an unmanaged master connector
but does not clean it up before its KUnit-owned storage is released.
[HOW]
Register a KUnit action after successful connector initialization to
run drm_connector_cleanup before freeing the master connector.
Assisted-by: Copilot:GPT-6-Astra
Reviewed-by: Bhawanpreet Lakha <bhawanpreet.lakha@amd.com>
Signed-off-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: George Zhang <george.zhang@amd.com>
Tested-by: Dan Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm')
| -rw-r--r-- | drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_mst_types_test.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_mst_types_test.c b/drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_mst_types_test.c index 382eafab2d43..eafa3e6733a6 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_mst_types_test.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_mst_types_test.c @@ -1311,6 +1311,13 @@ struct dm_mst_test_add_ctx { struct dc_link *link; }; +static void dm_mst_test_cleanup_add_ctx(void *data) +{ + struct amdgpu_dm_connector *master = data; + + drm_connector_cleanup(&master->base); +} + /* * Stand in for amdgpu_display_modeset_create_props(), which the test module * cannot link against. Only the properties amdgpu_dm_connector_init_helper() @@ -1368,6 +1375,8 @@ static void dm_mst_test_init_add_ctx(struct kunit *test, struct dm_mst_test_add_ ret = drm_connector_init(drm, &ctx->master->base, &dm_mst_test_connector_funcs, DRM_MODE_CONNECTOR_DisplayPort); KUNIT_ASSERT_EQ(test, ret, 0); + KUNIT_ASSERT_EQ(test, + kunit_add_action_or_reset(test, dm_mst_test_cleanup_add_ctx, ctx->master), 0); ctx->port = kunit_kzalloc(test, sizeof(*ctx->port), GFP_KERNEL); KUNIT_ASSERT_NOT_NULL(test, ctx->port); |
