Skip to content

Commit fa0048a

Browse files
quic-bjorandelumag
authored andcommitted
drm/msm/dp: Free resources after unregistering them
The DP component's unbind operation walks through the submodules to unregister and clean things up. But if the unbind happens because the DP controller itself is being removed, all the memory for those submodules has just been freed. Change the order of these operations to avoid the many use-after-free that otherwise happens in this code path. Fixes: c943b49 ("drm/msm/dp: add displayPort driver support") Signed-off-by: Bjorn Andersson <quic_bjorande@quicinc.com> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Patchwork: https://patchwork.freedesktop.org/patch/542166/ Link: https://lore.kernel.org/r/20230612220259.1884381-1-quic_bjorande@quicinc.com Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
1 parent a7bfb2a commit fa0048a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/gpu/drm/msm/dp/dp_display.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1300,9 +1300,9 @@ static int dp_display_remove(struct platform_device *pdev)
13001300
{
13011301
struct dp_display_private *dp = dev_get_dp_display_private(&pdev->dev);
13021302

1303+
component_del(&pdev->dev, &dp_display_comp_ops);
13031304
dp_display_deinit_sub_modules(dp);
13041305

1305-
component_del(&pdev->dev, &dp_display_comp_ops);
13061306
platform_set_drvdata(pdev, NULL);
13071307

13081308
return 0;

0 commit comments

Comments
 (0)