]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
drm/msm/dpu: don't mix devm and drmm functions
authorDmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Tue, 5 May 2026 00:24:58 +0000 (03:24 +0300)
committerDmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Wed, 13 May 2026 13:20:36 +0000 (16:20 +0300)
commitc0c70a11365cba7fba25a77463582bcec0f7846e
treef3354f60bb4555ed6787afd350e7062d8bf8baba
parent5b49a46baa853b26dbefa65c6c75dd9ff69f63d4
drm/msm/dpu: don't mix devm and drmm functions

Mixing devm and drmm functions will result in a use-after-free on msm
driver teardown if userspace keeps a reference on the drm device:
The WB connector data will be destroyed because of the use of
devm_kzalloc()), while the usersoace still can try interacting with the
WB connector (which uses drmm_ functions).

Change dpu_writeback_init() to use drmm_.

Fixes: 0b37ac63fc9d ("drm/msm/dpu: use drmm_writeback_connector_init()")
Reported-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Closes: https://lore.kernel.org/r/78c764b8-44cf-4db5-88e7-807a85954518@wanadoo.fr
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Reviewed-by: John.Harrison@Igalia.com
Patchwork: https://patchwork.freedesktop.org/patch/722656/
Link: https://lore.kernel.org/r/20260505-wb-drop-encoder-v5-1-42567b7c7af2@oss.qualcomm.com
drivers/gpu/drm/msm/disp/dpu1/dpu_writeback.c