Re: [PATCH] drm/amd/display: Fix pdev lifetime in dm_test_conn_init_ctx_alloc()

From: Chen, Chen-Yu

Date: Wed Nov 25 2026 - 05:32:03 EST



> Fix this by allocating pdev with kzalloc() and freeing it through
> the device release callback. This ensures pdev's lifetime is managed
> solely by the kobject.

Hi Tao,

Thanks for the report.

The lifetime problem in dm_test_conn_init_ctx_alloc() is real, but it has
already been addressed in amd-staging-drm-next by commit 370bab028b38
("drm/amd/display: Add more connector KUnit tests"). That commit allocates
pdev with devm_kzalloc() on the device and registers the unregister action
with devm_add_action_or_reset(), so devres releases the i2c adapter before
pdev is freed.

Your patch no longer applies to the current tree for that reason. Could you
please rebase it onto the latest amd-staging-drm-next and confirm whether the
issue still reproduces?

Thanks,
Chenyu