Commit e4337877 authored by Roy Spliet's avatar Roy Spliet Committed by Rob Clark

drm/msm/mdp5: Fix mdp5_init error path for failed mdp5_kms allocation

When allocation for mdp5_kms fails, calling mdp5_destroy() leads to undefined
behaviour, likely a nullptr exception or use-after-free troubles.
Signed-off-by: default avatarRoy Spliet <nouveau@spliet.org>
Reviewed-by: default avatarAbhinav Kumar <abhinavk@codeaurora.org>
Signed-off-by: default avatarRob Clark <robdclark@chromium.org>
parent e4b397f6
......@@ -943,7 +943,8 @@ static int mdp5_init(struct platform_device *pdev, struct drm_device *dev)
return 0;
fail:
mdp5_destroy(pdev);
if (mdp5_kms)
mdp5_destroy(pdev);
return ret;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment